This page shows how to start Fusion-CDN live streaming (FLS) using a custom domain.
Understand FLS modes
When using a custom domain, FLS provides two modes for you to build live streaming experiences:
|
Push CDN mode |
Pull CDN mode |
How it works |
You push streams to the FLS servers, and the FLS servers deliver the content to your audience. |
The FLS servers pull streams from your origin server and deliver the content to your audience. |
Applicable scenario |
No origin server is required |
An origin sever is required |
How to configure it |
Go to Agora Console. See Configure Push CDN mode. |
If you use a relatively fixed domain name, add it on Agora Console. See Configure Pull CDN mode. If you needs more flexibility, contact support@agora.io and provide a URL address, so that Agora can send a request to get your domain name before pulling streams. |
Prerequisites
Before proceeding, ensure that you meet the following requirements:
To configure your FLS mode, follow these steps:
- Configure either Push CDN mode or Pull CDN mode in Agora Console.
- Finish CNAME configuration.
If you need domain names for testing purposes, or if you need domain names provided by Agora that you can use in the production environment, contact
support@agora.io.
Follow these steps to configure Push CDN mode:
- Click the Config button for Fusion CDN to enter the configuration page.
- Click Push CDN on the top of the page.
- Add a stream-pushing domain:
- Click Add.
- Fill in your domain name for stream pushing, and select a region from the dropdown menu.
- Click Create.
By default, support for RTMPS is disabled, and the certificate and authentication information is blank. To edit these settings, click the icon.
- Add a playback domain:
- Click Add.
- Fill in your domain name for stream playback, and select a region from the dropdown menu.
- Click Create.
By default, support for HTTPS and cross-domain configuration is disabled, and the certificate and authentication information is blank. To edit these settings, click the icon.
- (Optional) Add an SSL certificate:
- Click Add.
- Create a name for the certificate.
- Upload your certificate (
.pem
or .crt
) and key (.key
) files.
- Click Save.
- (Optional) Configure the Agora Message Notification service for FLS events:
- Turn on the switch.
- Fill in your callback address to receive the message notifications.
- Click Save.
- Contact support@agora.io to enable the Agora Message Notification service.
Follow these steps to configure Pull CDN mode:
- Click the Config button for Fusion CDN to enter the configuration page.
- Click Pull CDN on the top of the page.
- Add the source domain:
- Turn on the switch
- Fill in the domain name of your origin server.
- Click Save.
- Add a playback domain:
- Click Add.
- Fill in your domain name for stream playback, and select a region from the dropdown menu.
- Click Create.
By default, support for HTTPS and cross-domain configuration is disabled, and the certificate and authentication information is blank. To edit these settings, click the icon.
- (Optional) Add an SSL certificate:
- Click Add.
- Create a name for the certificate.
- Upload your certificate (
.pem
or .crt
) and key (.key
) files.
- Click Save.
- (Optional) Configure the Agora Message Notification service for FLS events:
- Turn on the switch.
- Fill in your callback address to receive the message notifications.
- Click Save.
- Contact support@agora.io to enable the Agora Message Notification service.
Finish CNAME configuration
Once you add a stream-pushing or playback domain name when configuring Push CDN mode or Pull CDN mode, Agora automatically assigns it a CNAME ("canonical name") suffixed with .v1.agoramdn.com
. To use your custom domain name for live streaming, you need to add its CNAME to your domain's DNS settings, so that your domain name points to the CNAME. For details, refer to your DNS provider's instructions.
Implement FLS
Step 1: Construct the URL for pushing a live stream
Agora supports both RTMP and RTMPS. For details, see Construct the URL for pushing a live stream.
Step 2: Push the live stream
To push an RTMP/RTMPS stream, you can choose one of the following methods:
Step 3: Construct the URL for playing the live stream
Agora supports RTMP, HTTP-FLV, and HLS. For details, see Construct the URL for playing a live stream.
To get a playback URL that supports HTTP-based adaptive bitrate streaming (ABR), contact
support@agora.io.
Step 4: Play the live stream
Use the Agora MediaPlayer Kit or your own player to play the live stream.
Next steps
After implementing FLS, you can add the following live streaming functions through the FLS RESTful API: