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