This topic describes how to configure dependencies for your interactive live streaming project in the ApsaraVideo Live console, including ingest and streaming domains, interactive messaging applications, and SDK licenses. This guide covers the configuration process in the following order: Prerequisites, Ingest domain configuration, Streaming domain configuration, Interactive scenario configuration, Create an SDK license, and Recording and playback configuration.
Prerequisites
-
You have an Alibaba Cloud account and have completed real-name registration. For instructions, see individual real-name registration or enterprise real-name registration.
-
You have activated ApsaraVideo Live. For more information, see Activate ApsaraVideo Live.
-
You have prepared two domain names, one for ingest and one for streaming, and completed ICP filing for them. For more information, see Register an Alibaba Cloud Domain Name and ICP filing.
Note-
If your live center is located outside the Chinese mainland and you select Outside Chinese Mainland as your acceleration region, ICP filing is not required for your domain names.
-
If your ingest and streaming domains are both subdomains of the same primary domain name, you only need to obtain an ICP filing for the primary domain name.
-
-
You have attached the AliyunLiveFullAccess and AliyunVODFullAccess system policies to your RAM user. For instructions, see Create and authorize a RAM user.
Ingest domain configuration
Configure the ingest domain on the ApsaraVideo Live console.
Add an ingest domain
-
In the navigation pane on the left, choose Domains. On the Domain Management page, click Add Domain.
-
Configure the parameters to add your domain.
-
For Domain Type, select Ingest Domain.
-
For information about how to select an acceleration region, see Select an acceleration region for a domain name.
-
For Domain Name, enter your ingest domain.
-
For information about how to select a live center, see Select a live center.
ImportantThe ingest domain and streaming domain must be in the same live center region. This setting cannot be changed after the initial configuration.
NoteWhen adding a domain to ApsaraVideo Live for the first time, you must verify its ownership by following the on-screen prompts. For more information, see Verify domain ownership.
-
-
Click Next and follow the prompts to configure a CNAME record. This record directs user traffic to live streaming nodes for accelerated access.
DNS changes can take 5 to 10 minutes to propagate. After the verification is successful, Configured is displayed next to your ingest domain.
Your ingest domain is now configured. The result on the console is shown below.
On the Domain Management page, the Status of the ingest domain is Running.
The CNAME status on the console may update with a delay. The CNAME verification result is the definitive confirmation of a successful configuration.
View authentication key
The URL authentication feature protects your content from unauthorized access and piracy. This feature is enabled by default when you add a domain.
-
On the ApsaraVideo Live console, go to the Domains page. Find your ingest domain and click Configure in the Actions column.
-
Choose Stream Management > Access Control.
-
Find and record the primary key of your ingest domain for your server-side deployment.
On the URL Authentication tab, you can view the primary key in the Authentication URL Settings section.
Streaming domain configuration
Configure your streaming domain in the ApsaraVideo Live console.
Add streaming domain
Adding a streaming domain follows the same steps as adding an ingest domain. The only difference is that you must set Domain Type to Streaming Domain.
The streaming domain and ingest domain must use the same live center region.
In the domain list, the streaming domain shows a CNAME Status of Configured, a Live Center of China (Shenzhen), and a Status of Running.
View authentication key
URL authentication is enabled by default. Record and save the authentication primary key for the streaming domain. The steps are the same as for viewing the authentication key for the ingest domain.
Associate ingest domain
Next, associate the ingest domain with the corresponding streaming domain.
-
In the left-side navigation pane, choose Domains.
-
In the Domain Management list, find your target streaming domain and click Domain Settings.
-
Navigate to Stream Management > Basic Settings, click the Ingest Information tab, and then click Add Ingest Information.
-
Select the prepared ingest domain from the same live center, and click OK.
On the Ingest Information tab, you can view the associated ingest domain, CNAME, ingest protocols (RTMP and RTS are supported by default), ingest URL, and ingest callback URL.
Configure CORS
Cross-Origin Resource Sharing (CORS) is a standard HTML5 solution that allows a web page to load and access resources from a different origin. This enables secure cross-origin data transfer. For more information, see Cross-Origin Resource Sharing.
-
In the left-side navigation pane, choose Domains.
-
In the Domain Management list, find your target streaming domain and click Domain Settings.
-
Navigate to Stream Management > HTTP Header Configuration and click Add.
-
Set the parameter to
Access-Control-Allow-Originand the value to*.
For detailed instructions, see Configure HTTP headers.
Enable HTTPS
Configuring HTTPS acceleration encrypts critical user information during transmission. This prevents security risks such as sensitive information leakage caused by the interception of session IDs or cookies. It also ensures data integrity during transmission, preventing man-in-the-middle (MITM) attacks like DNS or content hijacking and tampering. For instructions, see Configure HTTPS secure acceleration.
After purchasing an SSL certificate, you must log on to the console to apply for it. The certificate can be used only after the application is approved. For more information, see Purchase a paid SSL certificate.
In the left-side navigation pane, choose HTTPS. In the HTTPS Certificate section on the right, the certificate switch is enabled and displays details such as the Certificate Type (for example, Cloud Shield certificate), Certificate Name, Certificate Brand, and Expiration Time.
Configure transcoding template
Live transcoding resolves playback issues, such as poor quality and video stuttering, that are caused by excessively high or low bitrates from the ingest source. For details on how to configure standard transcoding, see Configure standard transcoding.
Record the AppName, because the transcoding template is applied only when the AppName in the ingest URL matches the AppName in the template.
Activate RTS
Real-time Streaming (RTS) is a value-added feature of ApsaraVideo Live that provides a live video service with easy client access, ultra-low latency, high concurrency, and smooth HD streaming. For an overview, see Real-time Streaming (RTS).
-
Log on to the ApsaraVideo Live console.
-
In the navigation pane on the left, choose Feature Center > RTS.
-
Select a streaming domain.
-
Turn on the RTS switch and select Sub-second Latency (700ms-900ms end-to-end latency).
The sub-second latency mode supports RTMP and ARTC for ingest and HLS, FLV, RTMP, and ARTC for playback. Live streams that contain B-frames and AAC are not supported.
Interaction configuration
Create interactive messaging application
This project uses interactive messaging to control the live stream. Use cases include notifying viewers when the stream starts and ends, displaying announcements and viewer likes, muting viewers, and showing on-screen comments between the host and viewers. For co-streaming rooms, this also includes notifying the host of viewer requests to join the video stream. To enable these features, you must create an interactive messaging application.
-
In the left-side navigation pane of the ApsaraVideo Live console, choose .
-
Click Create Application.
-
In the Create Application dialog box, select a region and enter an application name. For now, you can leave callback settings and security moderation disabled.
-
Click Create. The new application is added to the list, and the system automatically generates an App ID, AppKey, AppSign, and creation time.
View the details and save the App ID, AppKey, and AppSign for your server-side deployment.
Create RTC application
This project supports both basic live rooms and co-streaming rooms. Co-streaming rooms allow viewers to request to join the stream by video. Because co-streaming rooms require audio and video co-streaming and stream mixing, you must create a Real-Time Communication (RTC) application. This feature enables viewers to co-stream with the host. The following figure shows the co-streaming model. When a viewer co-streams with the host, other viewers receive a mixed stream of all on-stage participants.

You must create an RTC application in the console. For a complete walkthrough of setting up a co-streaming scenario, see Quick start for co-streaming.
-
In the left-side navigation pane of the ApsaraVideo Live console, choose Features > Real-Time Communication > Application Management.
-
On the Application Management page, click Create Application, enter a custom instance name, select the Terms of Service checkbox, and then click Buy Now.
NoteCreating an application is free of charge. You are charged on a pay-as-you-go basis for your actual usage. For more information, see Billing of audio and video calls.
-
After the application is created, refresh the Application Management page to view it.
-
Click the RTC application. On the Server-side Transcoding and Streaming page, in the Global Server-side Transcoding and Streaming to ApsaraVideo Live section, enable server-side transcoding and streaming. For the streaming domain, enter the streaming domain that you added in the Add an ingest domain section (this domain cannot be a subdomain). Enable Single-stream Pushing. If you need to configure recording or snapshots, you must do so under this domain.
In the application list on the Application Management page, the new RTC application shows a Status of Enabled and a Billing Method of By Duration.
From the application's management page, find and save the App ID and AppKey for your server-side deployment.
Create SDK license
The ApsaraVideo MediaBox SDK used in this project requires a license. To ensure your project runs on mobile devices such as Android and iOS, we recommend applying for licenses for the Player, Ingest, and Beautification Effects modules based on your business needs.
-
In the left-side navigation pane of the ApsaraVideo Live console, choose SDK Management > My Subscriptions.
-
Click Create Application and Bind License.
-
Enter the application information based on your business requirements. For detailed parameter descriptions, see Manage licenses. After you complete the configuration, click Next.
-
Select the required feature modules and click Next.
-
For all feature modules, you can choose to use a trial version (valid for one month) or a commercial version (valid for one year). Each application can apply for one trial version per feature module.
-
The Beautification Effects module offers different versions. The defaults are Short Video Basic and Beautification Effects Basic. You can switch versions from the drop-down list based on your business needs.
-
You cannot switch versions for the Player and Live Ingest modules. The default is the Standard version.
-
Confirm your application information. If it is correct, click Create. To modify the information, click Previous.
After the application is created, return to the My Subscriptions page. Download the License File and save the License Key for your server-side deployment.
Recording and playback configuration
This project provides a playback feature for live rooms. You must add recording configurations to ensure that recordings are compatible with the playback feature.
Record to VOD (recommended)
The following steps describe how to configure standard live recording:
-
Log on to the ApsaraVideo Live console.
-
In the left-side navigation pane, click .
-
On the Live Recording page, select the streaming domain that you want to configure.
-
On the Store in VOD tab, click Add.
-
In the dialog box, select the appropriate transcoding template and click OK.
NoteWe recommend that you configure the transcoding template to transcode audio to AAC to ensure compatibility.
If you have not configured a transcoding template in ApsaraVideo VOD, go to the ApsaraVideo VOD console to configure one.
For detailed instructions, see Record and store in ApsaraVideo VOD.
Record to OSS
The following steps describe how to configure standard live recording:
-
Log on to the ApsaraVideo Live console.
-
In the left-side navigation pane, click .
-
On the Live Recording page, select the streaming domain that you want to configure.
-
On the Store in OSS tab, click Add.
-
In the dialog box, enable recording of transcoded streams, select a transcoding template ID, and then click OK. In the Recording Template (Store in OSS) dialog box, configure AppName, StreamName (enter
*for all streams), storage location, splicing duration (default is 180 seconds), the recording for timed-out streams switch, and the storage format (m3u8,flv,mp4, orcmaf).NoteFor detailed configuration instructions, see Record and store in Object Storage Service (OSS).
Summary
This topic covered all the preliminary configurations for an interactive live streaming project, including prerequisites, ingest domain configuration, streaming domain configuration, interactive scenario configuration, creating an SDK license, and recording and playback configuration. You must record the following information for your project deployment.
-
The domain name and authentication primary key for both the ingest and streaming domains.
-
The App ID, AppKey, and AppSign for the interactive messaging application.
-
The App ID and AppKey for the Real-Time Communication (RTC) application.
-
The License File and License Key for the ApsaraVideo MediaBox SDK.