LH-276: Add close-producer event handler; Update client #30

Merged
sergiu merged 9 commits from LH-276-close-producer into develop 2023-02-23 09:46:42 +00:00
Showing only changes of commit 29a4cd7227 - Show all commits

4
app.js
View File

@ -501,6 +501,7 @@ const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
try { try {
// Handlers for consumer transport https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-transportclose // Handlers for consumer transport https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-transportclose
if (isInitiator(callId, socketId)) { if (isInitiator(callId, socketId)) {
console.log('1videoCalls[callId].receiverAudioProducer', videoCalls[callId].receiverAudioProducer);
const producerId = videoCalls[callId].receiverAudioProducer.id; const producerId = videoCalls[callId].receiverAudioProducer.id;
if (!canConsume({ callId, producerId, rtpCapabilities })) return null; if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
@ -518,6 +519,7 @@ const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
console.log('audio returnData', returnData); console.log('audio returnData', returnData);
return returnData; return returnData;
} else { } else {
console.log('2videoCalls[callId].initiatorAudioProducer', videoCalls[callId].initiatorAudioProducer);
const producerId = videoCalls[callId].initiatorAudioProducer.id; const producerId = videoCalls[callId].initiatorAudioProducer.id;
if (!canConsume({ callId, producerId, rtpCapabilities })) return null; if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
@ -536,7 +538,7 @@ const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
return returnData; return returnData;
} }
} catch (error) { } catch (error) {
console.error(`[consumeAudio] | ERROR | error: ${error.message}`) console.error(`[consumeAudio] | ERROR | error: ${error}`)
} }
}; };