diff --git a/app.js b/app.js index 3d21d27..245c5c8 100644 --- a/app.js +++ b/app.js @@ -190,6 +190,9 @@ peers.on('connection', async socket => { consumer.on('transportclose', () => { console.log('transport close from consumer') + producer.close() + consumer.close() + router[callId] = null }) consumer.on('producerclose', () => { diff --git a/public/index.js b/public/index.js index 10cf6bd..4db5e57 100644 --- a/public/index.js +++ b/public/index.js @@ -61,6 +61,8 @@ if (IS_PRODUCER === true) { console.log('[VIDEO] notify-end | IS_PRODUCER', IS_PRODUCER, 'callId', callId); // socket.emit('transportclose') socket.emit('transportclose') + consumer = null + producer = null } }) }) @@ -272,7 +274,7 @@ const connectSendTransport = async () => { // close video track }) - producer.on('transportclose', { callId },() => { + producer.on('transportclose', () => { console.log('transport ended') // close video track })