WIP: router-close-connections #2

Closed
sergiu wants to merge 13 commits from router-close-connections into master
2 changed files with 6 additions and 3 deletions
Showing only changes of commit fdd0c438c4 - Show all commits

6
app.js
View File

@ -149,7 +149,7 @@ peers.on('connection', async socket => {
}) })
// see client's socket.emit('transport-produce', ...) // 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 // call produce based on the prameters from the client
producer = await producerTransport.produce({ producer = await producerTransport.produce({
kind, kind,
@ -157,6 +157,10 @@ peers.on('connection', async socket => {
}) })
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`) 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', () => { producer.on('transportclose', () => {
console.log('transport for this producer closed', callId) console.log('transport for this producer closed', callId)

View File

@ -217,7 +217,7 @@ const createSendTransport = () => {
return return
} }
console.log(params) console.log('params', params)
// creates a new WebRTC Transport to send media // creates a new WebRTC Transport to send media
// based on the server's producer transport params // based on the server's producer transport params
@ -264,7 +264,6 @@ const createSendTransport = () => {
errback(error) errback(error)
} }
}) })
connectSendTransport() connectSendTransport()
}) })
} }