From 6b822142d039164ace460770abc8a59e76a30467 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Sat, 11 Feb 2023 21:13:57 +0200 Subject: [PATCH] Add the kind of producer on new-producer event --- app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.js b/app.js index 5359aa8..3ed9f2b 100644 --- a/app.js +++ b/app.js @@ -260,7 +260,6 @@ peers.on('connection', async (socket) => { isInitiator(callId, socket.id) ? await videoCalls[callId].initiatorProducerTransport.connect({ dtlsParameters }) : await videoCalls[callId].receiverProducerTransport.connect({ dtlsParameters }); - } catch (error) { console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`); } @@ -370,8 +369,8 @@ peers.on('connection', async (socket) => { const socketToEmit = isInitiator(callId, socket.id) ? videoCalls[callId].receiverSocket : videoCalls[callId].initiatorSocket; - socketToEmit.emit('new-producer', { callId }); + socketToEmit.emit('new-producer', { callId, kind }); } catch (error) { console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`); }