Node.js
Creating a session that uses the Media Router
The following Node.js code creates a session that uses the Media Router:
Use the session ID in a Vonage Video client library to connect to a Vonage Video session.
You will also need to generate a token for each user connecting to the Vonage Video session. See Connection Token Creation for information on the generateToken() method.
The Media Router provides the following benefits:
- The Vonage Video Media Router can decrease bandwidth usage in multiparty sessions. (When the mediaMode property is set to
MediaMode.RELAYED, each client must send a separate audio-video stream to each client subscribing to it.) - The Vonage Video Media Router can improve the quality of the user experience through audio fallback and video recovery. With these features, if a client's connectivity degrades to a degree that it does not support video for a stream it's subscribing to, the video is dropped on that client (without affecting other clients), and the client receives audio only. If the client's connectivity improves, the video returns.
- The Vonage Video Media Router supports the archiving feature, which lets you record, save, and retrieve Vonage Video sessions.
Create Session
Use the Vonage Video Node.js SDK to learn how to create a session. Sessions allow participants to use audio, video, and messaging functionality in your application.
Available on:
Steps
1
Introduction2
Prerequisites3
Create a Session that uses Vonage Video Media Router4
Create a relayed session5
Create an automatically archived session6
Using sessions in client applications7
What's next?