Added callback for 'transport-produce'
This commit is contained in:
parent
c9ee906fc7
commit
e57cb94892
7
app.js
7
app.js
@ -229,7 +229,7 @@ peers.on('connection', async socket => {
|
|||||||
- For the router with the id callId, we make produce on producerTransport
|
- For the router with the id callId, we make produce on producerTransport
|
||||||
- Create the handler on producer at the 'transportclose' event
|
- Create the handler on producer at the 'transportclose' event
|
||||||
*/
|
*/
|
||||||
socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
|
socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => {
|
||||||
try {
|
try {
|
||||||
const callId = socketDetails[socket.id];
|
const callId = socketDetails[socket.id];
|
||||||
|
|
||||||
@ -257,6 +257,11 @@ peers.on('connection', async socket => {
|
|||||||
console.log('transport for this producer closed', callId)
|
console.log('transport for this producer closed', callId)
|
||||||
closeCall(callId);
|
closeCall(callId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Send back to the client the Producer's id
|
||||||
|
callback({
|
||||||
|
id: producer.id
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user