Remove callback with producer id from transport-produce

This commit is contained in:
Sergiu Toma 2022-08-31 16:43:59 +03:00
parent aaa1c5cea4
commit 4e92f6cdd3

8
app.js
View File

@ -149,13 +149,12 @@ 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 }, callback) => { socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
// 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,
rtpParameters, rtpParameters,
}) })
console.log('callback', callback);
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`) console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`)
producer.on('transportclose', () => { producer.on('transportclose', () => {
@ -168,11 +167,6 @@ peers.on('connection', async socket => {
router[callId].close() router[callId].close()
delete router[callId] delete router[callId]
}) })
// Send back to the client the Producer's id
callback({
id: producer.id
})
}) })
// see client's socket.emit('transport-recv-connect', ...) // see client's socket.emit('transport-recv-connect', ...)