parse transport-produce params
This commit is contained in:
parent
0c713ed286
commit
21e26d4be5
7
app.js
7
app.js
@ -215,10 +215,8 @@ peers.on('connection', async socket => {
|
||||
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
||||
try {
|
||||
const callId = socketDetails[socket.id];
|
||||
// console.log('🔴 typeof dtlsParameters', typeof dtlsParameters);
|
||||
// console.log('🟢 dtlsParameters', JSON.parse(dtlsParameters));
|
||||
// console.log('🟡 dtlsParameters', dtlsParameters);
|
||||
if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
|
||||
|
||||
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`);
|
||||
await videoCalls[callId].producerTransport.connect({ dtlsParameters });
|
||||
} catch (error) {
|
||||
@ -234,6 +232,9 @@ peers.on('connection', async socket => {
|
||||
socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
|
||||
try {
|
||||
const callId = socketDetails[socket.id];
|
||||
if (typeof kind === 'string') kind = JSON.parse(kind);
|
||||
if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters);
|
||||
|
||||
console.log('[transport-produce] | socket.id', socket.id, '| callId', callId);
|
||||
videoCalls[callId].producer = await videoCalls[callId].producerTransport.produce({
|
||||
kind,
|
||||
|
Loading…
Reference in New Issue
Block a user