LINXD-2209-black-screen-when-2-video-calls-are-answered-simultaneously #3

Merged
sergiu merged 31 commits from LINXD-2209-black-screen-when-2-video-calls-are-answered-simultaneously into master 2022-09-15 14:49:55 +00:00
2 changed files with 8 additions and 6 deletions
Showing only changes of commit 782b749ea3 - Show all commits

2
.env
View File

@ -1,3 +1,3 @@
PORT=3000
PORT=3001
IP=0.0.0.0 # Listening IPv4 or IPv6.
ANNOUNCED_IP=185.8.154.190 # Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).

12
app.js
View File

@ -118,11 +118,13 @@ const mediaCodecs = [
}
setInterval(async () => {
const { callId, callback } = queue.shift();
if (router[callId] === undefined) {
router[callId] = await worker.createRouter({ mediaCodecs })
console.log(`[createRoom] Router ID: ${router[callId].id}`)
getRtpCapabilities(callId, callback)
if (queue.length > 0) {
const { callId, callback } = queue.shift();
if (router[callId] === undefined) {
router[callId] = await worker.createRouter({ mediaCodecs })
console.log(`[createRoom] Router ID: ${router[callId].id}`)
getRtpCapabilities(callId, callback)
}
}
}, 2000);