Agora RTC Quick Start
Agora is a leading video, voice and live interactive streaming platform, helping developers deliver rich in-app experiences—including embedded voice and video chat, real-time recording, interactive live streaming, and real-time messaging.
Agora Interactive Live Streaming Premium enables one-to-many and many-to-many audio or video live streaming with the Agora RTC SDK.
Functions
Agora Live Interactive Audio Streaming boasts a flexible combination of functions for different scenarios.
Function | Description | Scenario |
---|---|---|
Co-hosting in a channel | An audience switches to a co-host and interacts with the existing host. | |
Co-hosting across channels | Hosts interact with each other across channels. | PK Hosting. |
Audio mixing | Sends the local and online audio with the user's voice to other audience members in the channel. | |
Screen sharing | Hosts share their screens with the audience in the channel. Supports specifying which screen or which window to share, and supports specifying the sharing region. | |
Basic image enhancement | Sets basic beauty effects, including skin smoothening, whitening, and cheek blushing. | Image enhancement in a video call. |
Modify the raw data | Developers obtain and modify the raw voice or video data of the SDK engine to create special effects, such as a voice change. | |
Inject an online media stream | Injects an external audio or video stream to an ongoing live interactive streaming channel. The host and audience in the channel can listen to or watch the stream while interacting with each other. You can set the attributes of the video source. | |
Customize the video source and renderer | Users process videos (from self-built cameras, screen sharing, or files) for image enhancement and filtering. | |
Push streams to the CDN | Sends the audio and video of your channel to other RTMP servers through the CDN: |
Version Update Description
Latest Version: 1.3.1_3.1
- Modify the service name from Agora Voice to Agora RTC
- Added video module and optimize performance.
v1.2.1_3.1.2
- Adapt to Cocos Creator 2.4.x.
v1.1.0_2.2.3.20_2.5.2
- Adapt to Cocos Creator 2.3.x.
v1.0.2_2.2.3.20_2.5.2
- Fix some bugs.
v1.0.1_2.2.3.20_2.5.2
- Integrated Agora service.
Enable Agora RTC Service
Use Cocos Creator to open the project that needs to be connected to Agora RTC service.
Click on Panel -> Service in the menu bar to open the Service panel, select Agora RTC service to go to the service detail page, and then click on the Enable button in the top right to enable the service. For details, please refer to the Cocos Service Operation Guide documentation.
Charge: Agora RTC services use the prepaid model. When your service usage exceeds the free portion of the service provider and the account balance is insufficient, the service will be stopped. At that time, you need to pre-charge in the Cocos Developer Console.
After the service is activated, Cocos Service will automatically activate the Agora RTC service, connect the Agora account, and integrate the Agora SDK into the game project.
Verify whether the service is integrated successfully
Once the Agora RTC service is integrated, we can verify the success of the Agora RTC service integration by adding simple code to the script.
Click Dashboard button in the Agora RTC service panel, jump to Agora Console. Then click icon in the left navigation menu to enter the Project Management page and obtain the App ID of the corresponding game.
Call the initialize method in the script and fill in the App ID obtained from the Agora console:
var appid = 'App ID obtained from the Agora console'; agora && agora.init(appid);
After the script is finished and saved, go back to the editor. Select the Browser and click the Preview button. If you can see the initialization log in the browser console, which means the integrate is successful.
Sample Project
Click the Sample button in Agora RTC service panel, Clone or download Voice-Call-for-Mobile-Gaming/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora project and then open the project in Cocos Creator. The Sample project contains the following functions:
- Join channel & leave channel.
- Publish or subscribe stream.
Enabling the Agora RTC service.
Double click to open the HelloWorld.js in Assets panel, then replace appid in the
initAgora
method with the App ID obtained from the Agora console.After the script is finished and saved, go back to the editor. Select the Browser and click the Preview button, you can debug the project in the browser.
Note: If you find that the Sample project is successfully initialized during debugging in the browser, but there is no callback when you click Join Channel, please confirm whether you have enabled the Agora RTC service in the Cocos Service panel.
Sample project of Interactive Live Video Streaming, please refer to Agora-Cocos-Quickstart.
Developer Guide
Please refer to Start Interactive Live Audio Streaming, Start Interactive Live Video Streaming and Start a Video Call documentations.
Reference Links
- Agora Platform Overview
- Agora Live Interactive Audio Streaming Overview
- Use an App ID for authentication
API Reference
Please refer to the Cocos Creator SDK API Reference documentation.