Compare commits

..

3 Commits

Author SHA1 Message Date
4a8afb7d47 Added logs for transport-produce 2022-09-30 10:07:30 +03:00
9470a2077f Remove console.log 2022-09-29 18:34:58 +03:00
21e26d4be5 parse transport-produce params 2022-09-29 18:33:40 +03:00

20
app.js
View File

@ -215,14 +215,12 @@ 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) {
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.stack}`);
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
}
});
@ -234,6 +232,19 @@ peers.on('connection', async socket => {
socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
try {
const callId = socketDetails[socket.id];
console.log('kind typeof', typeof kind);
console.log('kind', kind);
console.log('rtpParameters typeof', typeof rtpParameters);
console.log('rtpParameters', rtpParameters);
console.log('appData typeof', typeof appData);
console.log('appData', appData);
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,
@ -385,7 +396,6 @@ const createWebRtcTransportLayer = async (callId, callback) => {
dtlsParameters: transport.dtlsParameters,
};
console.log(`createWebRtcTransportLayer | params.dtlsParameters ${params.dtlsParameters}`);
// Send back to the client the params
callback({ params });