Check for initiatorConsumerAudio before resume()

This commit is contained in:
Sergiu Toma 2023-01-12 12:31:52 +02:00
parent b0293230b6
commit df5b3eab90

6
app.js
View File

@ -449,10 +449,12 @@ peers.on('connection', async socket => {
console.log(`[consumer-resume] callId ${callId}`)
if (isInitiator(callId, socket.id)) {
console.log('🟩');
console.log(`[consumer-resume] isInitiator true`);
await videoCalls[callId].initiatorConsumerVideo.resume();
await videoCalls[callId].initiatorConsumerAudio.resume();
(videoCalls[callId].initiatorConsumerAudio) && await videoCalls[callId].initiatorConsumerVideo.resume();
(videoCalls[callId].initiatorConsumerAudio) && await videoCalls[callId].initiatorConsumerAudio.resume();
} else {
console.log('🟥');
console.log(`[consumer-resume] isInitiator false`);
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerVideo.resume();
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerAudio.resume();