From d047cdf7d121f78e66a5f85c7d5920cb3f980810 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 29 Nov 2022 02:44:01 +0200 Subject: [PATCH] Update server --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index a586bc1..f684f20 100644 --- a/app.js +++ b/app.js @@ -364,12 +364,12 @@ peers.on('connection', async socket => { const callId = socketDetails[socket.id]; console.log('[consume] callId', callId); - const canConsumeVideo = videoCalls[callId]?.producerVideo && videoCalls[callId].router.canConsume({ + const canConsumeVideo = videoCalls[callId].producerVideo && !!videoCalls[callId].router.canConsume({ producerId: videoCalls[callId].producerVideo.id, rtpCapabilities }) - const canConsumeAudio = videoCalls[callId]?.producerAudio && videoCalls[callId].router.canConsume({ + const canConsumeAudio = videoCalls[callId].producerAudio && !!videoCalls[callId].router.canConsume({ producerId: videoCalls[callId].producerAudio.id, rtpCapabilities })