Added callback in transport-producer server
This commit is contained in:
parent
f479aaa96f
commit
fdd0c438c4
6
app.js
6
app.js
@ -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)
|
||||||
|
|
||||||
|
@ -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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user