LINXD-2209: Correctly set router to videoCalls
This commit is contained in:
parent
434c8f744c
commit
ead0069aa8
7
app.js
7
app.js
@ -101,7 +101,7 @@ const mediaCodecs = [
|
||||
|
||||
const getRtpCapabilities = (callId, callback) => {
|
||||
console.log('[getRtpCapabilities] callId', callId);
|
||||
const rtpCapabilities = videoCalls[callId] = { router: rtpCapabilities };
|
||||
const rtpCapabilities = videoCalls[callId].router.rtpCapabilities;
|
||||
callback({ rtpCapabilities });
|
||||
}
|
||||
|
||||
@ -118,11 +118,14 @@ peers.on('connection', async socket => {
|
||||
})
|
||||
|
||||
socket.on('createRoom', async ({ callId }, callback) => {
|
||||
if (videoCalls[callId] && videoCalls[callId].router === undefined) {
|
||||
console.log('[createRoom] videoCalls', videoCalls);
|
||||
if (!videoCalls[callId]) {
|
||||
console.log('create room');
|
||||
console.log('[createRoom] callId', callId);
|
||||
videoCalls[callId].router = await worker.createRouter({ mediaCodecs });
|
||||
console.log(`[createRoom] Router ID: ${videoCalls[callId].router.id}`)
|
||||
}
|
||||
console.log('room exists');
|
||||
socketDetails[socket.id] = callId;
|
||||
getRtpCapabilities(callId, callback);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user