LH-265-enable-audio-in-mediasoup #16

Closed
sergiu wants to merge 120 commits from LH-265-enable-audio-in-mediasoup into master
Showing only changes of commit a3b083fe24 - Show all commits

10
app.js
View File

@ -377,11 +377,11 @@ peers.on('connection', async socket => {
}) })
if (canConsumeVideo && !canConsumeAudio) { if (canConsumeVideo && !canConsumeAudio) {
const videoParams = consumeVideo() const videoParams = consumeVideo(callId)
callback({ videoParams, audioParams: null }); callback({ videoParams, audioParams: null });
} if (canConsumeVideo && canConsumeAudio) { } if (canConsumeVideo && canConsumeAudio) {
const videoParams = consumeVideo() const videoParams = consumeVideo(callId)
const audioParams = consumeAudio() const audioParams = consumeAudio(callId)
callback({ videoParams, audioParams }); callback({ videoParams, audioParams });
} else { } else {
console.log(`[canConsume] Can't consume | callId ${callId}`); console.log(`[canConsume] Can't consume | callId ${callId}`);
@ -409,7 +409,7 @@ peers.on('connection', async socket => {
}); });
}); });
const consumeVideo = async () => { const consumeVideo = async (callId) => {
videoCalls[callId].consumerVideo = await videoCalls[callId].consumerTransport.consume({ videoCalls[callId].consumerVideo = await videoCalls[callId].consumerTransport.consume({
producerId: videoCalls[callId].producerVideo.id, producerId: videoCalls[callId].producerVideo.id,
rtpCapabilities, rtpCapabilities,
@ -438,7 +438,7 @@ const consumeVideo = async () => {
} }
} }
const consumeAudio = async () => { const consumeAudio = async (callId) => {
videoCalls[callId].consumerAudio = await videoCalls[callId].consumerTransport.consume({ videoCalls[callId].consumerAudio = await videoCalls[callId].consumerTransport.consume({
producerId: videoCalls[callId].producerAudio.id, producerId: videoCalls[callId].producerAudio.id,
rtpCapabilities, rtpCapabilities,