Refactor consumer-resume

This commit is contained in:
Sergiu Toma 2023-01-12 14:32:48 +02:00
parent 9716bddd71
commit c037240f47

8
app.js
View File

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