diff --git a/app.js b/app.js index 943b8cf..7a9dc77 100644 --- a/app.js +++ b/app.js @@ -492,13 +492,21 @@ peers.on('connection', async (socket) => { const callId = socketDetails[socket.id]; const isInitiatorValue = isInitiator(callId, socket.id); console.log(`[consumer-resume] callId: ${callId} | isInitiator: ${isInitiatorValue}`); - // if (isInitiatorValue) { - // videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume(); - // videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume(); - // } else { - // videoCalls[callId].receiverConsumerVideo && videoCalls[callId].receiverConsumerVideo.resume(); - // videoCalls[callId].receiverConsumerAudio && videoCalls[callId].receiverConsumerAudio.resume(); - // } + if (isInitiatorValue) { + try { + videoCalls[callId].initiatorConsumerVideo && videoCalls[callId].initiatorConsumerVideo.resume(); + videoCalls[callId].initiatorConsumerAudio && videoCalls[callId].initiatorConsumerAudio.resume(); + } catch (error) { + 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) { console.error(`[consumer-resume] | ERROR | callId: ${socketDetails[socket.id]} | isInitiator: ${isInitiator} | error: ${error.message}`); }