diff --git a/app.js b/app.js index 76ea908..2ab3e52 100644 --- a/app.js +++ b/app.js @@ -302,13 +302,13 @@ peers.on('connection', async socket => { if (!isInitiator(callId, socket.id)) { console.log('🟥 Emit to initiatorSocket'); - initiatorSocket.emit('new-producer', { + videoCalls[callId].initiatorSocket.emit('new-producer', { callId }); } else { console.log('🟥 Emit to receiverSocket'); - receiverSocket.emit('new-producer', { + videoCalls[callId].receiverSocket.emit('new-producer', { callId }); }