Add new-producer event; Update client to consume when receives new-producer event #24

Merged
sergiu merged 4 commits from LAPI-675-generate-new-producer-in-mediasoup-and-client into develop 2023-01-16 15:40:06 +00:00
Showing only changes of commit 9382fd11fb - Show all commits

11
app.js
View File

@ -266,17 +266,6 @@ peers.on('connection', async (socket) => {
: videoCalls[callId].initiatorSocket;
socketToEmit.emit('new-producer', { callId });
// if (!isInitiator(callId, socket.id)) {
// await videoCalls[callId].receiverProducerTransport.connect({ dtlsParameters });
// videoCalls[callId].initiatorSocket.emit('new-producer', {
// callId,
// });
// } else {
// await videoCalls[callId].initiatorProducerTransport.connect({ dtlsParameters });
// videoCalls[callId].receiverSocket.emit('new-producer', {
// callId,
// });
// }
} catch (error) {
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
}
sergiu marked this conversation as resolved Outdated

We can refactor so that we only have one emit and connect instructions. Will be better when the new-producer messages changes.

We can refactor so that we only have one `emit` and `connect` instructions. Will be better when the `new-producer` messages changes.