From d91fcfd5840eacc755f2e2de3172b46cb82f46ba Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Mon, 20 Feb 2023 23:28:19 +0200 Subject: [PATCH] LH-276: Update producer close enent handler --- app.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 83230ba..f381b49 100644 --- a/app.js +++ b/app.js @@ -429,15 +429,8 @@ peers.on('connection', async (socket) => { // await videoCalls[callId].consumerTransport.connect({ dtlsParameters }); if (!isInitiator(callId, socket.id)) { await videoCalls[callId].receiverConsumerTransport.connect({ dtlsParameters }); - videoCalls[callId].receiverConsumerTransport.on('producerclose', () => { - console.log('🟦----------------producerclose receiverConsumerTransport'); - }); } else if (isInitiator(callId, socket.id)) { await videoCalls[callId].initiatorConsumerTransport.connect({ dtlsParameters }); - console.log('🟦----------------') - videoCalls[callId].initiatorConsumerTransport.on('producerclose', () => { - console.log('🟦----------------producerclose initiatorConsumerTransport'); - }); } } catch (error) { console.log(`ERROR | transport-recv-connect | callId ${socketDetails[socket.id]} | ${error.message}`); @@ -546,16 +539,17 @@ const consumeVideo = async (callId, socketId, rtpCapabilities) => { // https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-transportclose videoCalls[callId].initiatorConsumerVideo.on('transportclose', () => { - const callId = socketDetails[socket.id]; console.log('transport close from consumer', callId); closeCall(callId); }); // https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-producerclose videoCalls[callId].initiatorConsumerVideo.on('producerclose', () => { - const callId = socketDetails[socket.id]; - console.log('producer of consumer closed', callId); - closeCall(callId); + console.log('000000000000000000000000000 producer of consumer closed', callId); + }); + + videoCalls[callId].initiatorConsumerTransport.on('producerclose', () => { + console.log('000000000000000000000000000 producerclose initiatorConsumerTransport'); }); return {