LH-276: Update producer close event handler

This commit is contained in:
Sergiu Toma 2023-02-21 01:36:57 +02:00
parent 1dcc9321ba
commit 764087d1f6

10
app.js
View File

@ -492,14 +492,12 @@ peers.on('connection', async (socket) => {
const callId = socketDetails[socket.id]; const callId = socketDetails[socket.id];
const isInitiatorValue = isInitiator(callId, socket.id); const isInitiatorValue = isInitiator(callId, socket.id);
console.log(`[consumer-resume] callId: ${callId} | isInitiator: ${isInitiator}`); 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) { if (isInitiatorValue) {
videoCalls[callId]?.initiatorConsumerVideo?.resume(); videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume();
videoCalls[callId]?.initiatorConsumerAudio?.resume(); videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume();
} else { } else {
videoCalls[callId]?.receiverConsumerVideo?.resume(); videoCalls[callId].receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo.resume();
videoCalls[callId]?.receiverConsumerAudio?.resume(); videoCalls[callId].receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio.resume();
} }
} catch (error) { } catch (error) {
console.error(`[consumer-resume] | ERROR | callId: ${socketDetails[socket.id]} | isInitiator: ${isInitiator} | error: ${error.message}`); console.error(`[consumer-resume] | ERROR | callId: ${socketDetails[socket.id]} | isInitiator: ${isInitiator} | error: ${error.message}`);