LH-276: Update producer close event handler
This commit is contained in:
parent
bc07a055e0
commit
7e3e40e5e1
14
app.js
14
app.js
@ -521,13 +521,13 @@ peers.on('connection', async (socket) => {
|
||||
socket.on('close-producer', ({ callId, kind}) => {
|
||||
try {
|
||||
console.log(`[close-producer] callId: ${callId} | kind: ${kind}`);
|
||||
if (isInitiator(callId, socket.id)) {
|
||||
if (kind === 'video') videoCalls[callId].initiatorVideoProducer.close()
|
||||
else if (kind === 'audio') videoCalls[callId].initiatorAudioProducer.close()
|
||||
} else {
|
||||
if (kind === 'video') videoCalls[callId].receiverVideoProducer.close()
|
||||
else if (kind === 'audio') videoCalls[callId].receiverAudioProducer.close()
|
||||
}
|
||||
// if (isInitiator(callId, socket.id)) {
|
||||
// if (kind === 'video') videoCalls[callId].initiatorVideoProducer.close()
|
||||
// else if (kind === 'audio') videoCalls[callId].initiatorAudioProducer.close()
|
||||
// } else {
|
||||
// if (kind === 'video') videoCalls[callId].receiverVideoProducer.close()
|
||||
// else if (kind === 'audio') videoCalls[callId].receiverAudioProducer.close()
|
||||
// }
|
||||
} catch (error) {
|
||||
console.error(`ERROR | consumer-resume | callId ${socketDetails[socket.id]} | error: ${error.message}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user