From 0c917d647786f75954c5f04757146318e8018386 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Mon, 20 Feb 2023 19:42:47 +0200 Subject: [PATCH] LH-276: Add handlers for producer close --- app.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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({