LINXD-2329: Don't close the call if initiator or receiver close the transport #28
24
app.js
24
app.js
@ -223,18 +223,18 @@ peers.on('connection', async (socket) => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log(`[createWebRtcTransport] socket ${socket.id} | sender ${sender} | callId ${callId}`);
|
||||
if (sender) {
|
||||
if (!videoCalls[callId].receiverProducerTransport && !isInitiator(callId, socket.id)) {
|
||||
if (!isInitiator(callId, socket.id)) {
|
||||
videoCalls[callId].receiverProducerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||
} else if (!videoCalls[callId].initiatorProducerTransport && isInitiator(callId, socket.id)) {
|
||||
} else if (isInitiator(callId, socket.id)) {
|
||||
videoCalls[callId].initiatorProducerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||
} else {
|
||||
console.log(`producerTransport has already been defined | callId ${callId}`);
|
||||
callback(null);
|
||||
}
|
||||
} else if (!sender) {
|
||||
if (!videoCalls[callId].receiverConsumerTransport && !isInitiator(callId, socket.id)) {
|
||||
if (!isInitiator(callId, socket.id)) {
|
||||
videoCalls[callId].receiverConsumerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||
} else if (!videoCalls[callId].initiatorConsumerTransport && isInitiator(callId, socket.id)) {
|
||||
} else if (isInitiator(callId, socket.id)) {
|
||||
videoCalls[callId].initiatorConsumerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||
}
|
||||
}
|
||||
@ -291,8 +291,8 @@ peers.on('connection', async (socket) => {
|
||||
|
||||
videoCalls[callId].receiverVideoProducer.on('transportclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('transport for this producer closed', callId);
|
||||
closeCall(callId);
|
||||
console.log('[receiverVideoProducer] transport for this producer closed', callId);
|
||||
// closeCall(callId);
|
||||
});
|
||||
|
||||
// Send back to the client the Producer's id
|
||||
@ -312,8 +312,8 @@ peers.on('connection', async (socket) => {
|
||||
|
||||
videoCalls[callId].initiatorVideoProducer.on('transportclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('transport for this producer closed', callId);
|
||||
closeCall(callId);
|
||||
console.log('[initiatorVideoProducer] transport for this producer closed', callId);
|
||||
// closeCall(callId);
|
||||
});
|
||||
|
||||
callback &&
|
||||
@ -334,8 +334,8 @@ peers.on('connection', async (socket) => {
|
||||
|
||||
videoCalls[callId].receiverAudioProducer.on('transportclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('transport for this producer closed', callId);
|
||||
closeCall(callId);
|
||||
console.log('[receiverAudioProducer] transport for this producer closed', callId);
|
||||
// closeCall(callId);
|
||||
});
|
||||
|
||||
// Send back to the client the Producer's id
|
||||
@ -355,8 +355,8 @@ peers.on('connection', async (socket) => {
|
||||
|
||||
videoCalls[callId].initiatorAudioProducer.on('transportclose', () => {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log('transport for this producer closed', callId);
|
||||
closeCall(callId);
|
||||
console.log('[initiatorAudioProducer] transport for this producer closed', callId);
|
||||
// closeCall(callId);
|
||||
});
|
||||
|
||||
// Send back to the client the Producer's id
|
||||
|
@ -20353,7 +20353,7 @@ module.exports = yeast;
|
||||
},{}],94:[function(require,module,exports){
|
||||
module.exports = {
|
||||
hubAddress: 'https://hub.dev.linx.safemobile.com/',
|
||||
mediasoupAddress: 'https://video.safemobile.org',
|
||||
mediasoupAddress: 'https://testing.video.safemobile.org/',
|
||||
}
|
||||
},{}],95:[function(require,module,exports){
|
||||
const io = require('socket.io-client')
|
||||
@ -20830,7 +20830,7 @@ const connectRecvTransport = async () => {
|
||||
console.log('remoteVideo PLAY')
|
||||
})
|
||||
.catch((error) => {
|
||||
displayError(`remoteVideo PLAY ERROR | ${error.message}`)
|
||||
console.log(`remoteVideo PLAY ERROR | ${error.message}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
hubAddress: 'https://hub.dev.linx.safemobile.com/',
|
||||
mediasoupAddress: 'https://video.safemobile.org',
|
||||
mediasoupAddress: 'https://testing.video.safemobile.org/',
|
||||
}
|
@ -472,7 +472,7 @@ const connectRecvTransport = async () => {
|
||||
console.log('remoteVideo PLAY')
|
||||
})
|
||||
.catch((error) => {
|
||||
displayError(`remoteVideo PLAY ERROR | ${error.message}`)
|
||||
console.log(`remoteVideo PLAY ERROR | ${error.message}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user