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
Showing only changes of commit 5abc309502 - Show all commits

4
app.js
View File

@ -113,6 +113,7 @@ const mediaCodecs = [
const getRtpCapabilities = (callId, callback) => {
console.log('[getRtpCapabilities]', callId, callback);
const rtpCapabilities = router[callId].rtpCapabilities
callback({ rtpCapabilities })
}
@ -121,12 +122,13 @@ const mediaCodecs = [
if (queue.length > 0) {
const { callId, callback } = queue.shift();
if (router[callId] === undefined) {
console.log('🟢 callId', callId, '| callback', callback)
router[callId] = await worker.createRouter({ mediaCodecs })
console.log(`[createRoom] Router ID: ${router[callId].id}`)
getRtpCapabilities(callId, callback)
}
}
}, 2000);
}, 4000);
peers.on('connection', async socket => {
console.log('[connection] socketId:', socket.id)