diff --git a/app.js b/app.js index 7e97cec..eaa31d4 100644 --- a/app.js +++ b/app.js @@ -294,6 +294,11 @@ peers.on('connection', async (socket) => { closeCall(callId); }); + videoCalls[callId].receiverVideoProducer.on('close', () => { + const callId = socketDetails[socket.id]; + console.log('receiverVideoProducer for this producer closed', callId); + }); + // Send back to the client the Producer's id callback && callback({ @@ -315,6 +320,11 @@ peers.on('connection', async (socket) => { closeCall(callId); }); + videoCalls[callId].initiatorVideoProducer.on('close', () => { + const callId = socketDetails[socket.id]; + console.log('initiatorVideoProducer for this producer closed', callId); + }); + callback && callback({ id: videoCalls[callId].initiatorVideoProducer.id, @@ -337,6 +347,11 @@ peers.on('connection', async (socket) => { closeCall(callId); }); + videoCalls[callId].receiverAudioProducer.on('close', () => { + const callId = socketDetails[socket.id]; + console.log('receiverAudioProducer for this producer closed', callId); + }); + // Send back to the client the Producer's id callback && callback({ @@ -358,6 +373,11 @@ peers.on('connection', async (socket) => { closeCall(callId); }); + videoCalls[callId].initiatorAudioProducer.on('close', () => { + const callId = socketDetails[socket.id]; + console.log('initiatorAudioProducer for this producer closed', callId); + }); + // Send back to the client the Producer's id callback && callback({