From ea1c8e7e8021cc42932438bf9a6d7faf3aac0daa Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Mon, 20 Feb 2023 20:01:21 +0200 Subject: [PATCH] LH-276: Update producer close enent handler --- app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app.js b/app.js index a8297c9..4a29f56 100644 --- a/app.js +++ b/app.js @@ -327,6 +327,17 @@ peers.on('connection', async (socket) => { console.log('2 initiatorVideoProducer for this producer closed', callId); }) + videoCalls[callId].initiatorProducerTransport.observer.on("newproducer", (producer) => + { + console.log( + "new producer created [worker.pid:%d, router.id:%s, transport.id:%s, producer.id:%s]", producer.id); + + producer.observer.on("close", () => + { + console.log("producer closed [producer.id:%s]", producer.id); + }); + }); + callback && callback({ id: videoCalls[callId].initiatorVideoProducer.id,