comsume-undefined #22

Merged
sergiu merged 9 commits from comsume-undefined into develop 2023-01-12 13:31:47 +00:00
Showing only changes of commit 1342e812e6 - Show all commits

16
app.js
View File

@ -448,11 +448,19 @@ peers.on('connection', async socket => {
try { try {
const callId = socketDetails[socket.id]; const callId = socketDetails[socket.id];
if (isInitiator(callId, socket.id)) { if (isInitiator(callId, socket.id)) {
initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo?.resume(); if (videoCalls[callId]?.initiatorConsumerVideo){
initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio?.resume(); videoCalls[callId].initiatorConsumerVideo?.resume();

Check for videoCalls[callId].initiatorConsumerVideo is redundant.

Check for `videoCalls[callId].initiatorConsumerVideo` is redundant.
}
if (videoCalls[callId]?.initiatorConsumerAudio){
videoCalls[callId].initiatorConsumerAudio?.resume();
}
} else { } else {
receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo?.resume(); if (videoCalls[callId]?.receiverConsumerVideo) {
receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio?.resume(); videoCalls[callId].receiverConsumerVideo?.resume();
}
if (videoCalls[callId]?.receiverConsumerAudio) {
videoCalls[callId].receiverConsumerAudio?.resume();
}
} }
} catch (error) { } catch (error) {
console.log(`ERROR | consumer-resume | callId ${socketDetails[socket.id]} | ${error.message}`); console.log(`ERROR | consumer-resume | callId ${socketDetails[socket.id]} | ${error.message}`);