Compare commits

...

3 Commits

Author SHA1 Message Date
d67debc70b Add log on createRecvTransport 2022-08-16 14:21:02 +03:00
b64c49c1cd Refactor transportclose 21 2022-08-12 15:08:30 +03:00
383e34bf22 Refactor transportclose 20 2022-08-12 15:07:13 +03:00

17
app.js
View File

@ -109,6 +109,7 @@ peers.on('connection', async socket => {
})
socket.on('createRoom', async ({ callId }, callback) => {
console.log('[createRoom] callId', callId);
console.log('Router length:', Object.keys(router).length);
if (router[callId] === undefined) {
// worker.createRouter(options)
@ -252,8 +253,8 @@ const createWebRtcTransportLayer = async (callId, callback) => {
preferUdp: true,
}
console.log('webRtcTransport_options', webRtcTransport_options);
console.log('router', router, '| router[callId]', router[callId]);
// console.log('webRtcTransport_options', webRtcTransport_options);
// console.log('router', router, '| router[callId]', router[callId]);
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
let transport = await router[callId].createWebRtcTransport(webRtcTransport_options)
@ -269,15 +270,19 @@ const createWebRtcTransportLayer = async (callId, callback) => {
console.log('transport closed')
})
// send back to the client the following prameters
callback({
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
params: {
const params = {
id: transport.id,
iceParameters: transport.iceParameters,
iceCandidates: transport.iceCandidates,
dtlsParameters: transport.dtlsParameters,
}
console.log('params', params);
// send back to the client the following prameters
callback({
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
params
})
return transport