From f8fcfb316569ebff27e5781c6ff4f72c1b37bbf6 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Wed, 14 Dec 2022 11:33:16 +0200 Subject: [PATCH] Fix isInitiator in transport-produce --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 4a6fb98..a64718c 100644 --- a/app.js +++ b/app.js @@ -303,9 +303,9 @@ peers.on('connection', async socket => { console.log(`[transport-produce] kind: ${kind} | socket.id: ${socket.id} | callId: ${callId}`); console.log('kind', kind); console.log('rtpParameters', rtpParameters); - console.log('isInitiator()', isInitiator()); + console.log('isInitiator()', isInitiator(callId, socket.id)); if (kind === 'video') { - if (!isInitiator()) { + if (!isInitiator(callId, socket.id)) { console.log('----------1'); videoCalls[callId].receiverVideoProducer = await videoCalls[callId].receiverProducerTransport.produce({ kind, @@ -357,7 +357,7 @@ peers.on('connection', async socket => { }); } } else if (kind === 'audio') { - if (!isInitiator()) { + if (!isInitiator(callId, socket.id)) { videoCalls[callId].receiverAudioProducer = await videoCalls[callId].receiverProducerTransport.produce({ kind, rtpParameters,