From d324528d5290587f5090a21c5a0f2554b6796607 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Wed, 14 Dec 2022 11:05:40 +0200 Subject: [PATCH] Added logs on transport-produce --- app.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index e25d00d..4a6fb98 100644 --- a/app.js +++ b/app.js @@ -297,15 +297,16 @@ peers.on('connection', async socket => { */ socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => { try { - const callId = socketDetails[socket.id]; - if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters); - - console.log(`[transport-produce] kind: ${kind} | socket.id: ${socket.id} | callId: ${callId}`); - console.log('kind', kind); - console.log('rtpParameters', rtpParameters); - + const callId = socketDetails[socket.id]; + if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters); + + console.log(`[transport-produce] kind: ${kind} | socket.id: ${socket.id} | callId: ${callId}`); + console.log('kind', kind); + console.log('rtpParameters', rtpParameters); + console.log('isInitiator()', isInitiator()); if (kind === 'video') { if (!isInitiator()) { + console.log('----------1'); videoCalls[callId].receiverVideoProducer = await videoCalls[callId].receiverProducerTransport.produce({ kind, rtpParameters, @@ -337,6 +338,7 @@ peers.on('connection', async socket => { // id: videoCalls[callId].producerVideo.id // }); } else { + console.log('----------2'); videoCalls[callId].initiatorVideoProducer = await videoCalls[callId].initiatorProducerTransport.produce({ kind, rtpParameters,