Vonage Video Learning Server (Node.js)
Vonage Video Learning Server (Node.js)
1.3.0
Vonage Developer Relations
NodeJS
Sample Video Backend Server in Node.js
Sample Vonage Video NodeJS Server App
This simple server app shows you how to use Vonage Video Node Server SDK to create Vonage sessions, generate tokens for those sessions, archive (or record) sessions, and download those archives. You can use this sample server with any of our Sample Web Applications to test our our Video API, or use this as a start for your own sample implementation.
This sample server supports:
- Video Publishing Rooms - Create various rooms for participants to join.
- Video Archiving - Record meetings to download and view later.
- Signaling - Allow the backend to handle sending messages to connected clients
- Live Broadcasting - You can broadcast meetings via WebRTC, HLS, or to 3rd party RTMP Servers.
- SIP Connectivity - Allow users to call in, or call users directly, by using the Vonage Voice API SIP Gateway.
This project requires a Vonage Customer Account and access to the Vonage Video API in our Unified Environment.
Steps
-
To start, ensure you are signed into your Vonage developer account. If you do not have an account yet, you can create one here.
-
To immediately deploy the application, go to the ‘Deploy Code’ tab. Enter a name for your application in ‘Instance Name’, select your AWS region, and click the ‘Deploy Code’ button.
- You will see a pop up prompting you to add your Vonage API Key, Vonage API Secret, and assign your Vonage number to the application - you will be able to buy one here if you do not have one already.
- Click ‘Assign a number’ to select your number from the list, then continue to create the application.
- You will then see your new application under ‘Deployed Instances’. Click ‘Launch’ to run it.
-
To view the code and edit the application, go to ‘Get Code’ and click ‘Create a new development environment’.
- You will see a pop up prompting you to choose a region, enter a workspace name and assign your Vonage API Key, Vonage API Secret, and number to the application - you will be able to buy one here if you do not have one already.
- Click ‘Assign a number’ to select your number from the list, then continue to launch the workspace.
- When the workspace opens, you will see a README detailing how to edit, debug, run and deploy the project.
- Once your project is deployed, you can use the URL in the terminal output to access your application.
Usage
Once deployed, you have a fully functional server-side server that can be used to communicate with our Vonage Video API. You can then point your test mobile application or one of our various sample web applications at the URL we provide.
GET /- The homepage, with some information about various routesGET /session- Returns an Application ID, Session ID, and Client Token to join a video sessionGET /room/:name- Returns an Application ID, Session ID, and Client token for a custom-named roomGET /archive- View Available ArchivesPOST /archive/start- Start a video recordingGET /archive/:archiveId- Get Metadata about an archivePOST /archive/:archiveId/stop- Stop a specific video recordingGET /archive/:archiveId/view- View the specificed archive
For more information about running this server, please check out the GitHub Repository.