fix livekit
This commit is contained in:
@@ -11,7 +11,8 @@ const createToken = async () => {
|
|||||||
const roomName = "quickstart-room";
|
const roomName = "quickstart-room";
|
||||||
// Identifier to be used for participant.
|
// Identifier to be used for participant.
|
||||||
// It's available as LocalParticipant.identity with livekit-client SDK
|
// It's available as LocalParticipant.identity with livekit-client SDK
|
||||||
const participantName = "quickstart-username";
|
const participantName =
|
||||||
|
"quickstart-username" + Math.random().toString(36).substring(7);
|
||||||
|
|
||||||
const at = new AccessToken(
|
const at = new AccessToken(
|
||||||
process.env.LIVEKIT_API_KEY,
|
process.env.LIVEKIT_API_KEY,
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ export const Audio = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const joinRoom = async () => {
|
const joinRoom = async () => {
|
||||||
if (!connection.isConnected) return;
|
if (!connection.isConnected) return;
|
||||||
/* if (!token) return;
|
if (!token) return;
|
||||||
if (!process.env.NEXT_PUBLIC_LIVEKIT_URL)
|
if (!process.env.NEXT_PUBLIC_LIVEKIT_URL)
|
||||||
return console.error("NEXT_PUBLIC_LIVEKIT_URL not set");
|
return console.error("NEXT_PUBLIC_LIVEKIT_URL not set");
|
||||||
console.log("COnnecting to room", {
|
console.log("Connecting to room", {
|
||||||
token,
|
token,
|
||||||
url: process.env.NEXT_PUBLIC_LIVEKIT_URL,
|
url: process.env.NEXT_PUBLIC_LIVEKIT_URL,
|
||||||
}); */
|
});
|
||||||
const url = "ws://localhost:7880";
|
const url = "ws://localhost:7880";
|
||||||
const token =
|
/* const token =
|
||||||
"eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InF1aWNrc3RhcnQtcm9vbSJ9LCJpc3MiOiJBUElBbnNHZHRkWXAySG8iLCJleHAiOjE3NDIxNDk3MzAsIm5iZiI6MCwic3ViIjoicXVpY2tzdGFydC11c2VybmFtZSJ9.MVFDpwvjCF_AXjL9Mg40TFoKukZ4F3vOVB4DI_TZhHM";
|
"eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InF1aWNrc3RhcnQtcm9vbSJ9LCJpc3MiOiJBUElBbnNHZHRkWXAySG8iLCJleHAiOjE3NDIxNjAwOTIsIm5iZiI6MCwic3ViIjoicXVpY2tzdGFydC11c2VybmFtZSJ9.ih7my6oXby6yYBfzt5LXHKN5WZU9exIqS8CdpRJRLQI"; */
|
||||||
console.log("Connecting to room", { token, url });
|
console.log("Connecting to room", { token, url });
|
||||||
const room = new Room({
|
const room = new Room({
|
||||||
// automatically manage subscribed video quality
|
// automatically manage subscribed video quality
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ rtc:
|
|||||||
tcp_port: 7881
|
tcp_port: 7881
|
||||||
use_external_ip: false
|
use_external_ip: false
|
||||||
enable_loopback_candidate: false
|
enable_loopback_candidate: false
|
||||||
ice_servers:
|
# ice_servers:
|
||||||
- urls: ["stun:stun.l.google.com:19302"]
|
# - urls: ["stun:stun.l.google.com:19302"]
|
||||||
keys:
|
keys:
|
||||||
APIAnsGdtdYp2Ho: tdPjVsYUx8ddC7K9NvdmVAeLRF9GeADD6Fedm1x63fWC
|
APIAnsGdtdYp2Ho: tdPjVsYUx8ddC7K9NvdmVAeLRF9GeADD6Fedm1x63fWC
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
Reference in New Issue
Block a user