From 33e4122e1166d94505568f48464805e9756de57a Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Fri, 13 Jan 2023 19:40:50 +0200 Subject: [PATCH] test --- app.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 16d5e2e..eaf4270 100644 --- a/app.js +++ b/app.js @@ -301,18 +301,29 @@ peers.on('connection', async socket => { worker.pid, router.id, transport.id, producer.id ); - if (!isInitiator(callId, socket.id)) { - console.log('🟥 Emit to initiatorSocket'); - videoCalls[callId].initiatorSocket.emit('new-producer', { - callId - }); + // if (!isInitiator(callId, socket.id)) { + // console.log('🟥 Emit to initiatorSocket'); + // videoCalls[callId].initiatorSocket.emit('new-producer', { + // callId + // }); - } else { - console.log('🟥 Emit to receiverSocket'); - videoCalls[callId].receiverSocket.emit('new-producer', { - callId - }); - } + // } else { + // console.log('🟥 Emit to receiverSocket'); + // videoCalls[callId].receiverSocket.emit('new-producer', { + // callId + // }); + // } + + videoCalls[callId].initiatorSocket.emit('new-producer', { + callId + }); + videoCalls[callId].receiverSocket.emit('new-producer', { + callId + }); + socket.emit('new-producer', { + callId + }); + }); });