This commit is contained in:
Sergiu Toma 2023-01-13 19:40:50 +02:00
parent 1f3fbba5c0
commit 33e4122e11

33
app.js
View File

@ -301,18 +301,29 @@ peers.on('connection', async socket => {
worker.pid, router.id, transport.id, producer.id
);
if (!isInitiator(callId, socket.id)) {
console.log('🟥 Emit to initiatorSocket');
videoCalls[callId].initiatorSocket.emit('new-producer', {
callId
});
// if (!isInitiator(callId, socket.id)) {
// console.log('🟥 Emit to initiatorSocket');
// videoCalls[callId].initiatorSocket.emit('new-producer', {
// callId
// });
} else {
console.log('🟥 Emit to receiverSocket');
videoCalls[callId].receiverSocket.emit('new-producer', {
callId
});
}
// } else {
// console.log('🟥 Emit to receiverSocket');
// videoCalls[callId].receiverSocket.emit('new-producer', {
// callId
// });
// }
videoCalls[callId].initiatorSocket.emit('new-producer', {
callId
});
videoCalls[callId].receiverSocket.emit('new-producer', {
callId
});
socket.emit('new-producer', {
callId
});
});
});