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 d8405eccc7 - Show all commits

19
app.js
View File

@ -441,23 +441,18 @@ peers.on('connection', async socket => {
/* /*
- Event sent by the consumer after consuming to resume the pause - Event sent by the consumer after consuming to resume the pause
- When consuming on consumerTransport, it is initially done with paused: true, here we will resume - When consuming on consumerTransport, it is initially done with paused: true, here we will resume
- For the initiator we resume the initiatorConsumerAUDIO/VIDEO and for receiver the receiverConsumerAUDIO/VIDEO
*/ */
socket.on('consumer-resume', async () => { socket.on('consumer-resume',() => {
try { try {
const callId = socketDetails[socket.id]; const callId = socketDetails[socket.id];
console.log(`[consumer-resume] callId ${callId}`)
if (isInitiator(callId, socket.id)) { if (isInitiator(callId, socket.id)) {
console.log('🟩'); initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo?.resume();
console.log(`[consumer-resume] isInitiator true`); initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio?.resume();

Check for videoCalls[callId].initiatorConsumerVideo is redundant.

Check for `videoCalls[callId].initiatorConsumerVideo` is redundant.
await videoCalls[callId]?.initiatorConsumerVideo?.resume();
await videoCalls[callId]?.initiatorConsumerAudio?.resume();
} else { } else {
console.log('🟥'); receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo?.resume();
console.log(`[consumer-resume] isInitiator false`); receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio?.resume();
await videoCalls[callId]?.receiverConsumerVideo?.resume();
await 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}`);