LH-276: Update producer close event handler
This commit is contained in:
parent
9560d33870
commit
f5d45ce3a3
8
app.js
8
app.js
@ -335,6 +335,14 @@ peers.on('connection', async (socket) => {
|
||||
});
|
||||
videoCalls[callId].initiatorVideoProducer.observer.on("close", () => {
|
||||
console.log('====================2 initiatorVideoProducer for this producer closed', callId);
|
||||
// const socketToEmit = isInitiator(callId, socket.id)
|
||||
// ? videoCalls[callId].receiverSocket
|
||||
// : videoCalls[callId].initiatorSocket;
|
||||
|
||||
// // callId - Id of the call
|
||||
// // kind - producer type: audio/video
|
||||
// socketToEmit.emit('new-producer', { callId, kind });
|
||||
receiverSocket.emit('close-producer', { callId, kind });
|
||||
})
|
||||
|
||||
videoCalls[callId].initiatorVideoProducer.on('producerclose', () => {
|
||||
|
@ -20457,6 +20457,10 @@ setTimeout(() => {
|
||||
console.log(`🟢 new-producer | callId: ${callId} | kind: ${kind} | Ready to consume`);
|
||||
connectRecvTransport();
|
||||
})
|
||||
|
||||
socket.on('close-producer', ({ callId, kind }) => {
|
||||
console.log(`🔴 close-producer | callId: ${callId} | kind: ${kind}`);
|
||||
})
|
||||
}
|
||||
|
||||
if (IS_PRODUCER === true) {
|
||||
@ -20857,6 +20861,28 @@ const getVideoTrask = async (videoParams) => {
|
||||
consumerVideo.on("producerclose", () => {
|
||||
console.log('====================2 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.on("close", () => {
|
||||
console.log('====================3 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.on("close-producer", () => {
|
||||
console.log('====================4 consumerVideo producerclose');
|
||||
})
|
||||
|
||||
|
||||
|
||||
consumerVideo.observer.on('producerclose', () => {
|
||||
console.log('===================11 consumerVideo producerclose');
|
||||
});
|
||||
|
||||
consumerVideo.observer.on("producerclose", () => {
|
||||
console.log('====================22 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.observer.on("close", () => {
|
||||
console.log('====================33 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.observer.on("close-producer", () => {
|
||||
console.log('====================44 consumerVideo producerclose');
|
||||
})
|
||||
|
||||
return consumerVideo.track
|
||||
}
|
||||
|
@ -99,6 +99,10 @@ setTimeout(() => {
|
||||
console.log(`🟢 new-producer | callId: ${callId} | kind: ${kind} | Ready to consume`);
|
||||
connectRecvTransport();
|
||||
})
|
||||
|
||||
socket.on('close-producer', ({ callId, kind }) => {
|
||||
console.log(`🔴 close-producer | callId: ${callId} | kind: ${kind}`);
|
||||
})
|
||||
}
|
||||
|
||||
if (IS_PRODUCER === true) {
|
||||
@ -499,6 +503,28 @@ const getVideoTrask = async (videoParams) => {
|
||||
consumerVideo.on("producerclose", () => {
|
||||
console.log('====================2 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.on("close", () => {
|
||||
console.log('====================3 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.on("close-producer", () => {
|
||||
console.log('====================4 consumerVideo producerclose');
|
||||
})
|
||||
|
||||
|
||||
|
||||
consumerVideo.observer.on('producerclose', () => {
|
||||
console.log('===================11 consumerVideo producerclose');
|
||||
});
|
||||
|
||||
consumerVideo.observer.on("producerclose", () => {
|
||||
console.log('====================22 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.observer.on("close", () => {
|
||||
console.log('====================33 consumerVideo producerclose');
|
||||
})
|
||||
consumerVideo.observer.on("close-producer", () => {
|
||||
console.log('====================44 consumerVideo producerclose');
|
||||
})
|
||||
|
||||
return consumerVideo.track
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user