fix livekit

This commit is contained in:
nocnico
2025-03-16 22:22:09 +01:00
parent bba8297c03
commit e722adaf8e
3 changed files with 9 additions and 8 deletions

View File

@@ -11,7 +11,8 @@ const createToken = async () => {
const roomName = "quickstart-room";
// Identifier to be used for participant.
// 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(
process.env.LIVEKIT_API_KEY,

View File

@@ -35,16 +35,16 @@ export const Audio = () => {
useEffect(() => {
const joinRoom = async () => {
if (!connection.isConnected) return;
/* if (!token) return;
if (!token) return;
if (!process.env.NEXT_PUBLIC_LIVEKIT_URL)
return console.error("NEXT_PUBLIC_LIVEKIT_URL not set");
console.log("COnnecting to room", {
console.log("Connecting to room", {
token,
url: process.env.NEXT_PUBLIC_LIVEKIT_URL,
}); */
});
const url = "ws://localhost:7880";
const token =
"eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InF1aWNrc3RhcnQtcm9vbSJ9LCJpc3MiOiJBUElBbnNHZHRkWXAySG8iLCJleHAiOjE3NDIxNDk3MzAsIm5iZiI6MCwic3ViIjoicXVpY2tzdGFydC11c2VybmFtZSJ9.MVFDpwvjCF_AXjL9Mg40TFoKukZ4F3vOVB4DI_TZhHM";
/* const token =
"eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InF1aWNrc3RhcnQtcm9vbSJ9LCJpc3MiOiJBUElBbnNHZHRkWXAySG8iLCJleHAiOjE3NDIxNjAwOTIsIm5iZiI6MCwic3ViIjoicXVpY2tzdGFydC11c2VybmFtZSJ9.ih7my6oXby6yYBfzt5LXHKN5WZU9exIqS8CdpRJRLQI"; */
console.log("Connecting to room", { token, url });
const room = new Room({
// automatically manage subscribed video quality

View File

@@ -4,8 +4,8 @@ rtc:
tcp_port: 7881
use_external_ip: false
enable_loopback_candidate: false
ice_servers:
- urls: ["stun:stun.l.google.com:19302"]
# ice_servers:
# - urls: ["stun:stun.l.google.com:19302"]
keys:
APIAnsGdtdYp2Ho: tdPjVsYUx8ddC7K9NvdmVAeLRF9GeADD6Fedm1x63fWC
logging: