LINXD-2209: Added comments
This commit is contained in:
parent
6acd276324
commit
b85ba68c9c
32
app.js
32
app.js
@ -15,9 +15,26 @@ import path from 'path'
|
|||||||
const __dirname = path.resolve()
|
const __dirname = path.resolve()
|
||||||
|
|
||||||
import Server from 'socket.io'
|
import Server from 'socket.io'
|
||||||
import mediasoup, { getSupportedRtpCapabilities } from 'mediasoup'
|
import mediasoup from 'mediasoup'
|
||||||
|
|
||||||
let worker
|
let worker
|
||||||
|
/**
|
||||||
|
* videoCalls
|
||||||
|
* |-> Router
|
||||||
|
* |-> Producer
|
||||||
|
* |-> Consumer
|
||||||
|
* |-> Producer Transport
|
||||||
|
* |-> Consumer Transport
|
||||||
|
*
|
||||||
|
* '<callId>': {
|
||||||
|
* router: Router,
|
||||||
|
* producer: Producer,
|
||||||
|
* producerTransport: Producer Transport,
|
||||||
|
* consumer: Consumer,
|
||||||
|
* consumerTransport: Consumer Transport
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
**/
|
||||||
let videoCalls = {}
|
let videoCalls = {}
|
||||||
|
|
||||||
app.get('/', (_req, res) => {
|
app.get('/', (_req, res) => {
|
||||||
@ -39,19 +56,8 @@ httpsServer.listen(process.env.PORT, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const io = new Server(httpsServer)
|
const io = new Server(httpsServer)
|
||||||
|
|
||||||
// socket.io namespace (could represent a room?)
|
|
||||||
const peers = io.of('/mediasoup')
|
const peers = io.of('/mediasoup')
|
||||||
|
|
||||||
/**
|
|
||||||
* Worker
|
|
||||||
* |-> Router(s)
|
|
||||||
* |-> Producer Transport(s)
|
|
||||||
* |-> Producer
|
|
||||||
* |-> Consumer Transport(s)
|
|
||||||
* |-> Consumer
|
|
||||||
**/
|
|
||||||
|
|
||||||
const createWorker = async () => {
|
const createWorker = async () => {
|
||||||
worker = await mediasoup.createWorker({
|
worker = await mediasoup.createWorker({
|
||||||
rtcMinPort: 2000,
|
rtcMinPort: 2000,
|
||||||
@ -269,8 +275,6 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
|||||||
dtlsParameters: transport.dtlsParameters,
|
dtlsParameters: transport.dtlsParameters,
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('params', params);
|
|
||||||
|
|
||||||
// send back to the client the following prameters
|
// send back to the client the following prameters
|
||||||
callback({
|
callback({
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
||||||
|
Loading…
Reference in New Issue
Block a user