LH-276: Update producer close event handler

This commit is contained in:
Sergiu Toma 2023-02-21 01:41:53 +02:00
parent 00604279b5
commit 68db146643

22
app.js
View File

@ -492,13 +492,21 @@ 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: ${isInitiatorValue}`); console.log(`[consumer-resume] callId: ${callId} | isInitiator: ${isInitiatorValue}`);
// if (isInitiatorValue) { if (isInitiatorValue) {
// videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume(); try {
// videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume(); videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume();
// } else { videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume();
// videoCalls[callId].receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo.resume(); } catch (error) {
// videoCalls[callId].receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio.resume(); console.log('sssss', error.message);
// } }
} else {
try {
videoCalls[callId].receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo.resume();
videoCalls[callId].receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio.resume();
} catch (error) {
console.log('sssss22222', error.message);
}
}
} 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}`);
} }