Compare commits
3 Commits
dtls-test
...
4a8afb7d47
Author | SHA1 | Date | |
---|---|---|---|
4a8afb7d47 | |||
9470a2077f | |||
21e26d4be5 |
20
app.js
20
app.js
@ -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 });
|
||||
|
||||
|
Reference in New Issue
Block a user