LH-276: Update producer close enent handler

This commit is contained in:
Sergiu Toma 2023-02-20 23:21:48 +02:00
parent 2c777f4746
commit 12ad433c9f

7
app.js
View File

@ -429,8 +429,15 @@ peers.on('connection', async (socket) => {
// await videoCalls[callId].consumerTransport.connect({ dtlsParameters }); // await videoCalls[callId].consumerTransport.connect({ dtlsParameters });
if (!isInitiator(callId, socket.id)) { if (!isInitiator(callId, socket.id)) {
await videoCalls[callId].receiverConsumerTransport.connect({ dtlsParameters }); await videoCalls[callId].receiverConsumerTransport.connect({ dtlsParameters });
videoCalls[callId].receiverConsumerTransport.on('producerclose', () => {
console.log('🟦----------------producerclose receiverConsumerTransport');
});
} else if (isInitiator(callId, socket.id)) { } else if (isInitiator(callId, socket.id)) {
await videoCalls[callId].initiatorConsumerTransport.connect({ dtlsParameters }); await videoCalls[callId].initiatorConsumerTransport.connect({ dtlsParameters });
console.log('🟦----------------')
videoCalls[callId].initiatorConsumerTransport.on('producerclose', () => {
console.log('🟦----------------producerclose initiatorConsumerTransport');
});
} }
} catch (error) { } catch (error) {
console.log(`ERROR | transport-recv-connect | callId ${socketDetails[socket.id]} | ${error.message}`); console.log(`ERROR | transport-recv-connect | callId ${socketDetails[socket.id]} | ${error.message}`);