Moved 'new-producer' in 'transport-produce' handler
This commit is contained in:
parent
aca0a6eac0
commit
1da0170261
11
app.js
11
app.js
@ -261,11 +261,6 @@ peers.on('connection', async (socket) => {
|
|||||||
? await videoCalls[callId].initiatorProducerTransport.connect({ dtlsParameters })
|
? await videoCalls[callId].initiatorProducerTransport.connect({ dtlsParameters })
|
||||||
: await videoCalls[callId].receiverProducerTransport.connect({ dtlsParameters });
|
: await videoCalls[callId].receiverProducerTransport.connect({ dtlsParameters });
|
||||||
|
|
||||||
const socketToEmit = isInitiator(callId, socket.id)
|
|
||||||
? videoCalls[callId].receiverSocket
|
|
||||||
: videoCalls[callId].initiatorSocket;
|
|
||||||
socketToEmit.emit('new-producer', { callId });
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||||
}
|
}
|
||||||
@ -371,6 +366,12 @@ peers.on('connection', async (socket) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const socketToEmit = isInitiator(callId, socket.id)
|
||||||
|
? videoCalls[callId].receiverSocket
|
||||||
|
: videoCalls[callId].initiatorSocket;
|
||||||
|
socketToEmit.emit('new-producer', { callId });
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user