From 5169d0d49fc5af7ec5196bb38e43b39a29c21e6b Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 29 Nov 2022 02:39:11 +0200 Subject: [PATCH] Update server --- app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index fc1e6b5..3e84214 100644 --- a/app.js +++ b/app.js @@ -377,11 +377,11 @@ peers.on('connection', async socket => { }) if (canConsumeVideo && !canConsumeAudio) { - const videoParams = consumeVideo(callId) + const videoParams = consumeVideo(callId, rtpCapabilities) callback({ videoParams, audioParams: null }); } if (canConsumeVideo && canConsumeAudio) { - const videoParams = consumeVideo(callId) - const audioParams = consumeAudio(callId) + const videoParams = consumeVideo(callId, rtpCapabilities) + const audioParams = consumeAudio(callId, rtpCapabilities) callback({ videoParams, audioParams }); } else { console.log(`[canConsume] Can't consume | callId ${callId}`); @@ -409,7 +409,7 @@ peers.on('connection', async socket => { }); }); -const consumeVideo = async (callId) => { +const consumeVideo = async (callId, rtpCapabilities) => { videoCalls[callId].consumerVideo = await videoCalls[callId].consumerTransport.consume({ producerId: videoCalls[callId].producerVideo.id, rtpCapabilities, @@ -438,7 +438,7 @@ const consumeVideo = async (callId) => { } } -const consumeAudio = async (callId) => { +const consumeAudio = async (callId, rtpCapabilities) => { videoCalls[callId].consumerAudio = await videoCalls[callId].consumerTransport.consume({ producerId: videoCalls[callId].producerAudio.id, rtpCapabilities,