From 764087d1f6fc4eebea993dbb9be4d0669e5bb61e Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 21 Feb 2023 01:36:57 +0200 Subject: [PATCH] LH-276: Update producer close event handler --- app.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 4e207f4..29ca767 100644 --- a/app.js +++ b/app.js @@ -492,14 +492,12 @@ peers.on('connection', async (socket) => { const callId = socketDetails[socket.id]; const isInitiatorValue = isInitiator(callId, socket.id); console.log(`[consumer-resume] callId: ${callId} | isInitiator: ${isInitiator}`); - console.log('videoCalls[callId]?.receiverConsumerVideo?', videoCalls[callId]?.receiverConsumerVideo); - console.log('videoCalls[callId]?.receiverConsumerAudio', videoCalls[callId]?.receiverConsumerAudio); if (isInitiatorValue) { - videoCalls[callId]?.initiatorConsumerVideo?.resume(); - videoCalls[callId]?.initiatorConsumerAudio?.resume(); + videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume(); + videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume(); } else { - videoCalls[callId]?.receiverConsumerVideo?.resume(); - videoCalls[callId]?.receiverConsumerAudio?.resume(); + videoCalls[callId].receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo.resume(); + videoCalls[callId].receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio.resume(); } } catch (error) { console.error(`[consumer-resume] | ERROR | callId: ${socketDetails[socket.id]} | isInitiator: ${isInitiator} | error: ${error.message}`);