From ac5d5d7fd0e9970265b2fd5eab1b5ee3f416df0f Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Thu, 11 Aug 2022 13:15:23 +0300 Subject: [PATCH] Refactor transportclose 7 --- app.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index 5262295..437c731 100644 --- a/app.js +++ b/app.js @@ -156,14 +156,9 @@ peers.on('connection', async socket => { console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`) - producer.on('transportclose', ({ callId }) => { - console.log('transport for this producer closed', callId) - closeRoom(callId); - }) - producer.on('transportclose', () => { - console.log('transport2 for this producer closed', callId) - closeRoom(callId); + console.log('transport for this producer closed ') + producer.close() }) // Send back to the client the Producer's id @@ -192,14 +187,8 @@ peers.on('connection', async socket => { paused: true, }) - consumer.on('transportclose', ({ callId }) => { - console.log('transport close from consumer', callId) - closeRoom(callId); - }) - consumer.on('transportclose', () => { - console.log('transport2 close from consumer', callId) - closeRoom(callId); + console.log('transport close from consumer') }) consumer.on('producerclose', () => {