LINXD-2209: Correctly close the call

This commit is contained in:
Sergiu Toma 2022-09-15 09:56:32 +03:00
parent 19808da24e
commit c059dd5afc

6
app.js
View File

@ -198,23 +198,25 @@ peers.on('connection', async socket => {
})
videoCalls[callId].consumer.on('transportclose', () => {
const callId = socketDetails[socket.id];
console.log('transport close from consumer', callId)
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-close
stvideoCallsate[callId].router.close()
delete videoCalls[callId].router
videoCalls[callId].producer.close()
videoCalls[callId].consumer.close()
delete videoCalls[callId].router
})
videoCalls[callId].consumer.on('producerclose', () => {
const callId = socketDetails[socket.id];
console.log('producer of consumer closed', callId)
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-close
videoCalls[callId].router.close()
delete videoCalls[callId].router
videoCalls[callId].producer.close()
videoCalls[callId].consumer.close()
delete videoCalls[callId].router
})
// from the consumer extract the following params