LH-276: Update producer close event handler

This commit is contained in:
Sergiu Toma 2023-02-21 00:52:06 +02:00
parent 512d0f8bed
commit cf6725dec4

10
app.js
View File

@ -294,7 +294,7 @@ peers.on('connection', async (socket) => {
}); });
videoCalls[callId].receiverVideoProducer.observer.on("close", () => { videoCalls[callId].receiverVideoProducer.observer.on("close", () => {
console.log(`[close-producer] receiverVideoProducer | callId: ${callId} | kind: ${kind}`); console.log(`[close-producer] receiverVideoProducer receiver --EMIT--> initiator | callId: ${callId} | kind: ${kind}`);
videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind }); videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind });
}) })
@ -319,7 +319,7 @@ peers.on('connection', async (socket) => {
}); });
videoCalls[callId].initiatorVideoProducer.observer.on("close", () => { videoCalls[callId].initiatorVideoProducer.observer.on("close", () => {
console.log(`[close-producer] initiatorVideoProducer | callId: ${callId} | kind: ${kind}`); console.log(`[close-producer] initiatorVideoProducer initiator --EMIT--> receiver | callId: ${callId} | kind: ${kind}`);
videoCalls[callId].receiverSocket.emit('close-producer', { callId, kind }); videoCalls[callId].receiverSocket.emit('close-producer', { callId, kind });
}) })
@ -345,7 +345,7 @@ peers.on('connection', async (socket) => {
}); });
videoCalls[callId].receiverAudioProducer.observer.on("close", () => { videoCalls[callId].receiverAudioProducer.observer.on("close", () => {
console.log(`[close-producer] receiverAudioProducer | callId: ${callId} | kind: ${kind}`); console.log(`[close-producer] receiverAudioProducer receiver --EMIT--> initiator | callId: ${callId} | kind: ${kind}`);
videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind }); videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind });
}) })
@ -370,8 +370,8 @@ peers.on('connection', async (socket) => {
}); });
videoCalls[callId].initiatorAudioProducer.observer.on("close", () => { videoCalls[callId].initiatorAudioProducer.observer.on("close", () => {
console.log(`[close-producer] initiatorAudioProducer | callId: ${callId} | kind: ${kind}`); console.log(`[close-producer] initiatorAudioProducer initiator --EMIT--> receiver | callId: ${callId} | kind: ${kind}`);
videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind }); videoCalls[callId].receiverSocket.emit('close-producer', { callId, kind });
}) })
// Send back to the client the Producer's id // Send back to the client the Producer's id