Compare commits
7 Commits
add-diagra
...
21e26d4be5
Author | SHA1 | Date | |
---|---|---|---|
21e26d4be5 | |||
0c713ed286 | |||
817781085f | |||
a95c29659e | |||
5d451d961f | |||
1d47d02792 | |||
8ac58f0d9d |
10
app.js
10
app.js
@ -215,10 +215,12 @@ peers.on('connection', async socket => {
|
||||
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
||||
try {
|
||||
const callId = socketDetails[socket.id];
|
||||
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 });
|
||||
} catch (error) {
|
||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.stack}`);
|
||||
}
|
||||
});
|
||||
|
||||
@ -230,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,
|
||||
@ -381,6 +386,7 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
||||
dtlsParameters: transport.dtlsParameters,
|
||||
};
|
||||
|
||||
console.log(`createWebRtcTransportLayer | params.dtlsParameters ${params.dtlsParameters}`);
|
||||
// Send back to the client the params
|
||||
callback({ params });
|
||||
|
||||
|
Reference in New Issue
Block a user