WIP: router-close-connections #2
6
app.js
6
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)
|
||||
|
||||
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user