- What's New
- Service Overview
-
Billing
- Billing Items
- Basic Service Billing
- Value-added Service Billing
- Billing Modes
- Changing the Billing Option
- Bills
- Arrears
- Billing Termination
-
Billing FAQs
-
Common Cases
- What Do I Need to Pay?
- Do I Need to Buy the CDN Service Before Using Live?
- How Do I Change the Billing Option?
- Do I Need to Delete Resources If I Don't Want to Use Live Any More?
- How Do I View the Usage and Expenditure of Pay-per-Use Live Resources?
- Is Downstream Traffic or Upstream Traffic Billed?
- Will I Be Billed for URL Validation?
- How Is Transcoding Billed?
- Does the Daily Peak Bandwidth Mean the Upstream Bandwidth or Downstream Bandwidth?
- Why Is a Recording Fee Deducted on the First Day of Each Month?
- Arrears
-
Common Cases
- Cloud Live
-
Media Live
- Overview
- Scenarios
- Functions
- Product Advantages
- Constraints
- Getting Started
-
Console Operations
- Prerequisites
- Functions
- Permissions Management
- Domain Name Management
- Channels
- Live Transcoding
- Service Monitoring
- Cloud Resource Authorization
- Tools
- Best Practices
-
Cloud Live API Reference
- Before You Start
- API Overview
- Calling APIs
- Examples
-
Domain Name Management
- Creating a Domain Name
- Deleting a Domain Name
- Modifying a Domain Name
- Querying a Domain Name
- Mapping Domain Names
- Deleting a Domain Name Mapping
- Configuring the Domain Name IPv6 Function
- Querying IP Address Information
- Modifying the Streaming Domain Name Delay
- Querying the Streaming Domain Name Delay
- Modifying the HLS Configuration of a Domain Name
- Querying HLS Configurations of Domain Names
- Modifying Origin Pull Settings
- Querying Origin Pull Settings
- Notification Management
-
Authentication Management
- Configuring a Referer Validation ACL
- Deleting a Referer Validation ACL
- Querying Referer Validation ACLs
- Querying IP Address ACLs
- Modifying an IP Address ACL
- Generating a Signed URL
- Querying Supported Areas of a Streaming Domain Name
- Modifying Supported Areas of a Streaming Domain Name
- Querying the URL Validation Configuration of a Specified Domain Name
- Modifying the URL Validation Configuration of a Specified Domain Name
- Deleting the URL Validation Configuration of a Specified Domain Name
- Snapshot Management
- Recording Management
- Recording Callback Management
- HTTPS Certificate Management
- OBS Bucket Management
- Transcoding Template Management
- Stream Management
-
Statistics Analysis
- Querying Peak Bandwidth
- Querying Total Traffic
- Querying HTTP Status Codes for Pulling Live Streams
- Querying the Duration of Transcoded Outputs
- Querying Recording Channels
- Querying the Number of Snapshots
- Querying Upstream Bandwidth
- Querying the Number of Stream Channels
- Querying the Historical Stream List
- Querying the Playback Profile
- Querying the Distribution of Live Streaming Metrics by Region
- Stream Analytics
- Appendix
- Change History
-
Media Live API Reference
- Before You Start
- API Overview
- Calling APIs
- Examples
-
OTT Channel Management
- Creating an OTT Channel
- Querying Channel Information
- Deleting Channel Information
- Modifying Channel Packaging Information
- Modifying Channel Input Stream Information
- Modifying Channel Recording Information
- Modifying General Channel Information
- Changing the Channel Status
- Modifying Channel Transcoding Template Information
- Appendix
- Change History
- Cloud Live Server SDK Reference
- Low Latency Live Client SDK Reference
- Troubleshooting
Audio Autoplay Blocking
What Is Audio Autoplay Blocking?
Automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users. In order to give users control over this, browsers often provide audio autoplay blocking policies. During audio autoplay, audio autoplay blocking policies may be triggered when users do not engage with the page. However, audio autoplay will not be blocked in non-autoplay or muted autoplay scenarios. Specifically, if the audio or video tag contains the autoplay attribute, autoplay is blocked after the page is loaded. If the play API is forcibly called, an error message similar to Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first will be reported.
HTML:
<video src="/video_with_audio.mp4" autoplay></video>
JavaScript:
videoElement.play();
Autoplay of a video with an audio track on a new page will be denied by the browser.
PlayButton.addEventListener('click', () => { videoElement.play(); })
LLL SDK Error Messages Caused by Audio Autoplay Blocking
When the LLL SDK is used to autoplay an LLL livestream with sound:
const options = { elementId: 'elementId', autoPlay: true, } startPlayPromise = playClient.startPlay(streamUrl, options)
Set autoPlay to true. If autoPlay is not specified, the default value true is used. When audio autoplay is blocked, the browser console reports the following error message:
[HWLLS] [error] [HLLSTrack] [play audio failed: ["code": 51000000, "message": "the user didn't interact with the document first, please trigger by gesture."] ] ### lll play SDK occur error: {"errCode":51000000,"errDesc":"the user didn't interact with the document first, please trigger by gesture."}
If Error is reported during listening, error code 51000000 is displayed:
playClient.on('Error', (resp) => { if (resp.errCode === 51000000) { // Error message on audio autoplay blocking } })
Best Practices
Manual playback
Example of muted autoplay using the LLL SDK:
const options = { elementId: 'elementId', autoPlay: false } startPlayPromise = playClient.startPlay(streamUrl, options)
Set autoPlay to false and add a playback button so that the playback starts only when the user clicks the button.

Listening on autoplay errors
Autoplay with sound:
const options = { elementId: 'elementId', autoPlay: true, } startPlayPromise = playClient.startPlay(streamUrl, options)
Listening error code on audio autoplay blocking:
playClient.on('Error', (resp) => { if (resp.errCode === 51000000) { // Error message on audio autoplay blocking // Add the button unmute on the page. } })
In this case, even if audio autoplay is blocked, the video is still played without sound. If the user wants to hear the sound, the user can click unmute to play the audio. When audio autoplay is not blocked, the video will be played with sound.


Sample Code
The LLL SDK needs to be decompressed to the sdk/ directory.
- Listening on Autoplay Errors shows the sample code of listening on autoplay errors.
- Manual Playback shows the sample code of manual playback.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.