Merge pull request 'LH-253: Added callId for transportclose and producerclose events' (#12) from LH-253-mediasoup-handle-callid-undefined into master
Reviewed-on: #12
This commit is contained in:
commit
be5f97762a
6
app.js
6
app.js
@ -109,7 +109,7 @@ const mediaCodecs = [
|
||||
|
||||
const closeCall = (callId) => {
|
||||
try {
|
||||
if (videoCalls[callId]) {
|
||||
if (callId && videoCalls[callId]) {
|
||||
videoCalls[callId].producer?.close();
|
||||
videoCalls[callId].consumer?.close();
|
||||
videoCalls[callId]?.consumerTransport?.close();
|
||||
@ -299,14 +299,14 @@ peers.on('connection', async socket => {
|
||||
videoCalls[callId].consumer.on('transportclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('transport close from consumer', callId);
|
||||
closeCall();
|
||||
closeCall(callId);
|
||||
});
|
||||
|
||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-producerclose
|
||||
videoCalls[callId].consumer.on('producerclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('producer of consumer closed', callId);
|
||||
closeCall();
|
||||
closeCall(callId);
|
||||
});
|
||||
|
||||
// From the consumer extract the following params to send back to the Client
|
||||
|
Loading…
Reference in New Issue
Block a user