This commit is contained in:
Sergiu Toma 2023-01-13 19:01:54 +02:00
parent 256687f284
commit 2a43cd2603

8
app.js
View File

@ -197,10 +197,10 @@ peers.on('connection', async socket => {
console.log(`[createRoom] Router ID: ${videoCalls[callId].router.id}`); console.log(`[createRoom] Router ID: ${videoCalls[callId].router.id}`);
videoCalls[callId].receiverSocket = socket; videoCalls[callId].receiverSocket = socket;
console.log('------------', videoCalls[callId].receiverSocket); console.log('------------', videoCalls[callId].receiverSocket);
console.log('🟦 videoCalls[callId].receiverSocket.socket.id', videoCalls[callId].receiverSocket.socket.id) console.log('🟦 videoCalls[callId].receiverSocket.socket.id', videoCalls[callId].receiverSocket.id)
} else { } else {
videoCalls[callId].initiatorSocket = socket; videoCalls[callId].initiatorSocket = socket;
console.log('🟦 videoCalls[callId].initiatorSocket.id', videoCalls[callId].initiatorSocket.socket.id) console.log('🟦 videoCalls[callId].initiatorSocket.id', videoCalls[callId].initiatorSocket.id)
} }
socketDetails[socket.id] = callId; socketDetails[socket.id] = callId;
// rtpCapabilities is set for callback // rtpCapabilities is set for callback
@ -647,8 +647,8 @@ const consumeAudio = async (callId, socketId, rtpCapabilities) => {
} }
const isInitiator = (callId, socketId) => { const isInitiator = (callId, socketId) => {
console.log('videoCalls[callId].initiatorSocket.id', videoCalls[callId].initiatorSocket.socket.id); console.log('===============videoCalls[callId].initiatorSocket.id', videoCalls[callId].initiatorSocket.id);
console.log('socketId', socketId); console.log('===============socketId', socketId);
return (videoCalls[callId].initiatorSocket.socket.id === socketId); return (videoCalls[callId].initiatorSocket.socket.id === socketId);
} }