LH-276: Add close-producer event handler; Update client #30
8
app.js
8
app.js
@ -500,7 +500,7 @@ const consumeVideo = async ({ callId, socketId, rtpCapabilities }) => {
|
|||||||
const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
|
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) && videoCalls[callId].receiverAudioProducer) {
|
||||||
console.log('1videoCalls[callId].receiverAudioProducer', videoCalls[callId].receiverAudioProducer);
|
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,7 +518,7 @@ const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
|
|||||||
};
|
};
|
||||||
console.log('audio returnData', returnData);
|
console.log('audio returnData', returnData);
|
||||||
return returnData;
|
return returnData;
|
||||||
} else {
|
} else if (videoCalls[callId].initiatorAudioProducer) {
|
||||||
console.log('2videoCalls[callId].initiatorAudioProducer', videoCalls[callId].initiatorAudioProducer);
|
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,9 +536,11 @@ const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
|
|||||||
};
|
};
|
||||||
console.log('audio returnData', returnData);
|
console.log('audio returnData', returnData);
|
||||||
return returnData;
|
return returnData;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[consumeAudio] | ERROR | error: ${error}`)
|
console.error(`[consumeAudio] | ERROR | error: ${error}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user