From b85ba68c9cb81e161fb8bb9f25e3ce2e4efc3cc5 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 13 Sep 2022 22:24:10 +0300 Subject: [PATCH] LINXD-2209: Added comments --- app.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index a8dd3eb..925b963 100644 --- a/app.js +++ b/app.js @@ -15,9 +15,26 @@ import path from 'path' const __dirname = path.resolve() import Server from 'socket.io' -import mediasoup, { getSupportedRtpCapabilities } from 'mediasoup' +import mediasoup from 'mediasoup' let worker +/** + * videoCalls + * |-> Router + * |-> Producer + * |-> Consumer + * |-> Producer Transport + * |-> Consumer Transport + * + * '': { + * router: Router, + * producer: Producer, + * producerTransport: Producer Transport, + * consumer: Consumer, + * consumerTransport: Consumer Transport + * } + * + **/ let videoCalls = {} app.get('/', (_req, res) => { @@ -39,19 +56,8 @@ httpsServer.listen(process.env.PORT, () => { }) const io = new Server(httpsServer) - -// socket.io namespace (could represent a room?) const peers = io.of('/mediasoup') -/** - * Worker - * |-> Router(s) - * |-> Producer Transport(s) - * |-> Producer - * |-> Consumer Transport(s) - * |-> Consumer - **/ - const createWorker = async () => { worker = await mediasoup.createWorker({ rtcMinPort: 2000, @@ -269,8 +275,6 @@ const createWebRtcTransportLayer = async (callId, callback) => { 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