Added logs

This commit is contained in:
Sergiu Toma 2022-09-29 18:26:59 +03:00
parent 817781085f
commit 0c713ed286

9
app.js
View File

@ -215,10 +215,11 @@ peers.on('connection', async socket => {
socket.on('transport-connect', async ({ dtlsParameters }) => { socket.on('transport-connect', async ({ dtlsParameters }) => {
try { try {
const callId = socketDetails[socket.id]; const callId = socketDetails[socket.id];
console.log('🔴 typeof dtlsParameters', typeof dtlsParameters); // console.log('🔴 typeof dtlsParameters', typeof dtlsParameters);
console.log('🟢 dtlsParameters', JSON.parse(dtlsParameters)); // console.log('🟢 dtlsParameters', JSON.parse(dtlsParameters));
console.log('🟡 dtlsParameters', dtlsParameters); // console.log('🟡 dtlsParameters', dtlsParameters);
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`) if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`);
await videoCalls[callId].producerTransport.connect({ dtlsParameters }); await videoCalls[callId].producerTransport.connect({ dtlsParameters });
} catch (error) { } catch (error) {
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.stack}`); console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.stack}`);