Close producer when dispatcher close the window
This commit is contained in:
parent
14d96fa7c5
commit
1ab77c1f17
3
app.js
3
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', () => {
|
||||
|
@ -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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user