Agora provides an open-source One-to-One-Video sample project on GitHub. This document introduces how to run this project and experience a video call implemented by the Agora SDK.
Create a project in Agora Console, as follows:
Log in to Console, and click in the left navigation menu to enter the Project Management page.
Enter your project name, and select Secure mode: APP ID + Token for the authentication mechanism in the pop-up window.
Click Submit. You can see the created project on the Project Management page.
Agora automatically assigns each project an App ID as a unique identifier.
To copy this App ID, find your project on the Project Management page in Agora Console, and click the eye icon to the right of the App ID.
To ensure communication security, Agora uses tokens (dynamic keys) to authenticate users joining a channel.
Agora Console supports generating temporary tokens for testing purposes.
On the Project Management page, find your project, and click to open the Token page.
Enter a channel name, and click Generate Temp Token to get a temporary token. When joining the channel, ensure that the channel name is the same with the one that you use to generate the temporary token.
Integrate the Agora SDK into the sample project, as follows:
.jsfile starting with
assetsfolder in the Agora-Web-Tutorial-1to1 project, and rename the file to
Run the sample project to join a video call, as follows:
index.html file in Chrome. You will see the Basic Communication page:
Enter the App ID and temporary token, as well as the channel name that you use to generate the temporary token.
Click JOIN, and allow the browser to access your camera and microphone in the pop-up window.
You should see a video stream of yourself on the page.
To try a one-to-one video call, duplicate the browser tab, enter the same App ID, channel name, and temporary token, and then click JOIN.
You should see two video streams in each browser window.
If the sample project does not work properly, open the browser console and check for errors. The following are the most likely errors:
INVALID_VENDOR_KEY: Incorrect App ID or token. Ensure that you enter the correct App ID and token.
DYNAMIC_USE_STATIC_KEY: Token missing. Because your Agora project enables App Certificate, you need a token to join the channel.
Media access:NotFoundError: Camera/microphone error. Check that your camera and microphone are working properly.
The following table lists the code structure of the sample project for your reference:
||The code of the web page and the main functions.|
||The code for the front-end style.|
||Third-party libraries for the front-end style and layout.|
Agora provides the following additional video call sample projects on GitHub: