Compare commits

..

No commits in common. "6fd6ca97556fda21e2b81128ef4c642bfa6ac4e5" and "b0293230b636d460cafee876a561c86cd3cc8b63" have entirely different histories.

16
app.js
View File

@ -441,19 +441,21 @@ peers.on('connection', async socket => {
/*
- Event sent by the consumer after consuming to resume the pause
- When consuming on consumerTransport, it is initially done with paused: true, here we will resume
- For the initiator we resume the initiatorConsumerAUDIO/VIDEO and for receiver the receiverConsumerAUDIO/VIDEO
- When consuming on consumerTransport, it is initially done with paused: true, here we will resume
*/
socket.on('consumer-resume',() => {
socket.on('consumer-resume', async () => {
try {
const callId = socketDetails[socket.id];
console.log(`[consumer-resume] callId ${callId}`)
if (isInitiator(callId, socket.id)) {
videoCalls[callId]?.initiatorConsumerVideo?.resume();
videoCalls[callId]?.initiatorConsumerAudio?.resume();
console.log(`[consumer-resume] isInitiator true`);
await videoCalls[callId].initiatorConsumerVideo.resume();
await videoCalls[callId].initiatorConsumerAudio.resume();
} else {
videoCalls[callId]?.receiverConsumerVideo?.resume();
videoCalls[callId]?.receiverConsumerAudio?.resume();
console.log(`[consumer-resume] isInitiator false`);
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerVideo.resume();
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerAudio.resume();
}
} catch (error) {
console.log(`ERROR | consumer-resume | callId ${socketDetails[socket.id]} | ${error.message}`);