Agora Native SDK for Web Reference Manual¶
The Agora Native SDK for Web provides web browsers with open access to the Agora Global Network.
The Agora Native SDK for Web allows you to perform the following operations:
- Session setup: Join and leave shared Agora conferencing sessions (identified by unique channel names), where there may be many global users conferenced together or simply one other user for one-to-one communication. Your application code should create and manage unique channel names; these usually originate in user, session, and date/time information that your application is already managing.
- Media control: Enable and disable voice and video (allowing muting) and set various voice and video parameters that help the Agora Native SDK optimize communications. Many of the SDK operations are automated and do not require developer intervention if these parameter settings are not provided.
- Device control: Access the microphone or speakerphone, set the volume, select from alternative cameras, and set the video window display.
- Session control: Receive events when other users join or leave a conferencing session (channel), and understanding who’s speaking, who’s muted, and who’s viewing the session. These events allow the application to decide when to make changes to the delivery of video and audio streams, and other application-specific user and status information.
- Quality management: Obtain statistics and quality indicators about network conditions, run built-in tests, submit ratings and complaints about sessions and enable different levels of error logging.
- Recording: Record audio or video and audio in one or multiple channels simultaneously. This function is only applicable to the users who have adopted the Recording Key schema.For details, refer to Agora Recording Server.
- Data Encryption: Encrypt the audio and video packets.
- Whiteboard: Provide a simple collaboration platform on the whiteboard where users from different locations can draw, annotate, and share PDF documents to visualize and simplify the communication. For details, refer to Agora Whiteboard SDK.
- Screen Sharing: Share the desktop or window with another user. When the screen sharing function is enabled, the other person’s screen displays your shared desktop or window instead of the camera video.
- A single Client object for establishing and controlling sessions.
- Multiple Stream objects for managing different voice and video media streams.
- Top-level AgoraRTC object for creating the appropriate Client and Stream objects.
For details on the API definition and sample code, see API Reference - Agora Native SDK for Web.
Native SDK 1.3 or later
|Windows 10||Chrome||51.0.2704.103 (64 bit)|
- Do not use an unsupported browser, for example, Opera, Firefox, and Chrome browsers are not supported and will behave unpredictably.
- Chrome is supported on Windows at 640x480p 30fps resolution. Other higher resolutions will be supported in future releases.
Operating System Requirements¶
|Windows||Windows 7 or later|
|Mac||OS X v10.10 or later|
Capabilities and Limitations¶
- The maximum supported video resolution：720p 15fps and 480p 30fps.
- A PC can only have one instance running.
|./agent||It includes the following applications:|
|./client||Sample web application.|
|./doc||Agora Web SDK Documentation:|
|Agora Native SDK for Web Reference Manual v1_6_EN.pdf|
|Agora Native SDK for Web Reference Manual v1_6_CHS.pdf|
|./server||Web service-side sample code|
This section describes the concepts and use of App ID, App Certificate, Dynamic Key, Channel Key and Recording Key. For details, see Agora Keys User Guide.
Developing and Deploying Application¶
Load the Agora JS library AgoraRTCSDK-1.6.0js which can be downloaded from:
Running the Sample Web Application¶
The default sample code only requires your static App ID (which is simply entered into the sample application web page). To run the provided sample web application:
- Ensure that you have a local web server installed, such as Apache, NginX, or Node.js.
- Deploy the files under./client/ to your web server.
- Access the sample application page on your web server using one of the browsers listed in Supported Browsers.
Do the following if you want to run the sample application with a Channel Key:
- Set up and launch the key-generation server.
- Make an http/https request from the client to the key-generation server to fetch the generated Channel Key.
- Call AgoraRTC.client.join.
This code is only required when you want to experiment with using more secure Channel Key. In production use, you integrate this logic into your own server-side applications and (re)code this in the programming languages you are already using for your server-based functionality.
- Install a standard Node.js server in your server or cloud infrastructure.
- Run npm install under ../server/nodejs/.
- Fill in the values of your VENDOR_KEY and SIGN_KEY in ../server/nodejs/DemoServer.js.
- Launch the server with node DemoServer.js.
Installing AgoraWebAgent on Windows or Mac¶
After your deployment, the client will ask your users to install the AgoraWebAgent application on their Windows or Mac according to the system prompt. The system prompt includes a download link and an installation guide provided by Agora, and your users can directly use them or you can customize them to redirect the users to your website. The following shows the installation guide again for your customization convenience:
- Double-click the AgoraWebAgent.exe downloaded from the system prompt.
- Select the language for installation: English.
- Click Browse... if you want to select a different folder. Otherwise, click Next>.
- Click Install and wait until the progress bar is completed.
- Select Run AgoraWebAgent.exe and then click Finish.
Once the program is installed, a shortcut is displayed on the Desktop and AgoraWebAgent starts up automatically whenever starting the computer. An icon will display at the lower right part of the toolbar if AgoraWebAgent is running. Users can disable/enable the automatic start-up in the task manager. If the plugin program is closed while using the Agora Video Call on the browser, restart it by clicking the shortcut on desktop. Once it is restarted, it starts up automatically again whenever starting the computer.
- Double-click the AgoraWebAgent.pkg downloaded from the system prompt.
- Click Continue on the installer.
- Click Continue.
- Click Install to install the application on the default location.
- Enter your computer username and password. Proceed with Install Software.
- When the following message displays, the installation is complete. Click Close.
Once AgoraWebAgent is installed, it is in the Applications directory by default, and it starts up automatically whenever starting the computer. An icon will display at the upper right part of the toolbar if AgoraWebAgent is running. You can disable/enable the automatic start-up by right-clicking the icon. If the program is closed while using the Agora Video Call on browser, restart it by clicking the icon in ‘/Applications’ . Once it is restarted, it starts up automatically again whenever starting the computer.
Uninstalling AgoraWebAgent on Windows or Mac¶
The uninstallation procedure is the same as uninstalling any other application on Windows XP, Windows 7, Windows 8, and so on.
Take Windows 8 for example:
- Go to Desktop> Control Panel.
- Click Uninstalling the Applications under Applications.
- Find AgoraWebAgent.exe and right click it to select uninstall.
- Wait until the progress is finished.
- Go to Finder on the Docker.
- Click and enter the folder Applications.
- Find the installed AgoraWebAgent and right click it to select Move to Trash.
The Agora Native SDK supports built-in encryption using the AES-128 or AES-256 encryption algorithm. If your application has integrated the built-in encryption of Agora SDK, then users are able to record an encrypted channel.
You can call setEncryptionSecret to enable the encryption function and then call setEncryptionMode to set the mode to be used. For details, see API Reference - Agora Native SDK for Web.
The following diagram depicts the built-in encryption/decryption process: