parse-params #9

Closed
sergiu wants to merge 13 commits from parse-params into master
Showing only changes of commit 0c713ed286 - Show all commits

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}`);