Start Broadcast Streaming using a custom domain
This page shows how to start Broadcast Streaming using a custom domain.
Understand Broadcast Streaming modes
When using a custom domain, Broadcast Streaming provides two modes for you to build live streaming experiences:
Push CDN mode | Pull CDN mode | |
---|---|---|
How it works | You push streams to the Broadcast Streaming servers, and the Broadcast Streaming servers deliver the content to your audience. | The Broadcast Streaming 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. |
Prerequisites
Before proceeding, ensure that you meet the following requirements:
- Enable Broadcast Streaming in Agora Console.
- Decide an Broadcast Streaming mode according to your business scenario.
Configure Broadcast Streaming modes
To configure your Broadcast Streaming mode, follow these steps:
- Configure either Push CDN mode or Pull CDN mode in Agora Console.
- Finish CNAME configuration.
Configure Push CDN mode
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 Broadcast Streaming 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.
Configure Pull CDN mode
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 Broadcast Streaming 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 Broadcast Streaming
Step 1: Construct the URL for pushing a live stream
Agora supports both sRTMP 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:
- Use streaming software, such as OBS. See Streaming Software Configuration.
- Use the Media Push RESTful API to convert live streams within an Agora channel to an RTMP/RTMPS stream. See Media Push RESTful API Reference.
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.
Step 4: Play the live stream
Use the Agora MediaPlayer Kit or your own player to play the live stream.
Next steps
After implementing Broadcast Streaming, you can add the following live streaming functions through the Broadcast Streaming RESTful API:
- Stream pushing/playing authentication
- Transcoding
- Snapshot and content moderation
- Stream management
- Message notification (coming soon)
- Recording (coming soon)