From acd6025f591620fc7aa2378ac3234b62f7717356 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Fri, 16 Dec 2022 02:07:01 +0200 Subject: [PATCH] Update --- app.js | 5 ++++- public/index.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 7934240..d1f07e9 100644 --- a/app.js +++ b/app.js @@ -223,8 +223,11 @@ peers.on('connection', async socket => { - If the client is producer(sender: true) then it will use parameters for device.createSendTransport(params) - If the client is a consumer(sender: false) then it will use parameters for device.createRecvTransport(params) */ - socket.on('createWebRtcTransport', async ({ sender }, callback) => { + socket.on('createWebRtcTransport', async (data, callback) => { try { + console.log('createWebRtcTransport-----------------------data', data); + const { sender } = data + console.log('createWebRtcTransport-----------------------sender', sender); const callId = socketDetails[socket.id]; console.log(`[createWebRtcTransport] socket ${socket.id} | sender ${sender} | callId ${callId}`); if (sender) { diff --git a/public/index.js b/public/index.js index 86b9d90..9233a51 100644 --- a/public/index.js +++ b/public/index.js @@ -222,7 +222,7 @@ const createSendTransport = () => { console.log('[createSendTransport'); // see server's socket.on('createWebRtcTransport', sender?, ...) // this is a call from Producer, so sender = true - socket.emit('createWebRtcTransport', { sender: true, callId }, (value) => { + socket.emit('createWebRtcTransport', { sender: true }, (value) => { console.log(`[createWebRtcTransport] value: ${JSON.stringify(value)}`);