diff --git a/app.js b/app.js index ea1b705..520ae55 100644 --- a/app.js +++ b/app.js @@ -149,7 +149,7 @@ peers.on('connection', async socket => { }) // see client's socket.emit('transport-produce', ...) - socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => { + socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => { // call produce based on the prameters from the client producer = await producerTransport.produce({ kind, @@ -157,6 +157,10 @@ peers.on('connection', async socket => { }) console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`) + // If we have multiple producers/consumers on the same room + // We need to notify all the consumers of the room + // --- code --- + producer.on('transportclose', () => { console.log('transport for this producer closed', callId) diff --git a/public/index.js b/public/index.js index ce85a24..1524bb6 100644 --- a/public/index.js +++ b/public/index.js @@ -217,7 +217,7 @@ const createSendTransport = () => { return } - console.log(params) + console.log('params', params) // creates a new WebRTC Transport to send media // based on the server's producer transport params @@ -264,7 +264,6 @@ const createSendTransport = () => { errback(error) } }) - connectSendTransport() }) }