Fix isInitiator in transport-produce

This commit is contained in:
Sergiu Toma 2022-12-14 11:33:16 +02:00
parent d324528d52
commit f8fcfb3165

6
app.js
View File

@ -303,9 +303,9 @@ peers.on('connection', async socket => {
console.log(`[transport-produce] kind: ${kind} | socket.id: ${socket.id} | callId: ${callId}`);
console.log('kind', kind);
console.log('rtpParameters', rtpParameters);
console.log('isInitiator()', isInitiator());
console.log('isInitiator()', isInitiator(callId, socket.id));
if (kind === 'video') {
if (!isInitiator()) {
if (!isInitiator(callId, socket.id)) {
console.log('----------1');
videoCalls[callId].receiverVideoProducer = await videoCalls[callId].receiverProducerTransport.produce({
kind,
@ -357,7 +357,7 @@ peers.on('connection', async socket => {
});
}
} else if (kind === 'audio') {
if (!isInitiator()) {
if (!isInitiator(callId, socket.id)) {
videoCalls[callId].receiverAudioProducer = await videoCalls[callId].receiverProducerTransport.produce({
kind,
rtpParameters,