Media server
Overview
Mediasoup has an SFU (Selective Forwarding Unit) topology, where the server routes media around between participants while balancing its limitations with the media inputs it receives. With this approach, participants send their media to the server and receive others' media in separate streams, one each.
For more details of how mediasoup works and how we interacted with it within the browser, check out their documentation:
Data Structures
For the Data Structures, we store the rooms associated with the media server, and each room has a Worker, a Router and a state associated.
A state has Transports associated as well as a map Producers for each type (video and audio) and a list of Consumers of those Producers.
Operations
In the media_server/src/utils/startRabbit
directory it is possible to see the operations that are handled by the media server using typescript definitions:
And also what's returned at those operations:
How to run locally:
Execute inside the media_server/
directory:
npm i
npm run build
npm start
Edit the src/config.js
file according to your needs and create an .env
file accordingly to the .env.example
.