From 753b476462b593df9b7d6768d54e9349bdf00e95 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 29 Nov 2022 02:42:13 +0200 Subject: [PATCH] Update server --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 31d835b..a586bc1 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 })