After videos are uploaded to ApsaraVideo for VOD and transcoded, they can be played. You can preview videos on the video management page of the ApsaraVideo for VOD console. You can also play videos by using ApsaraVideo Player SDK. Alternatively, you can send video playback URLs to a third-party player (the native player of the operating system, an open-source player, or your self-developed player) for video playback. This topic describes the playback prerequisites and how to resolve the common playback issues that may occur during your use of ApsaraVideo for VOD. Before playing audio or videos in ApsaraVideo for VOD, ensure that the following configurations are correct:
- Service activation
- Video processing
- Security configuration
- Network environment
On the ApsaraVideo for VOD product page, clickBuy Now.
You do not have overdue payments in ApsaraVideo for VOD.
- Domain name acquisition: To register, transfer, or purchase a domain name, visit HiChina. You can select the required domain name on the domain name management page of HiChina.
- Domain name configuration: After obtaining a domain name, you need to bind a CNAME record to the domain name. For more information, see the configuration procedures for HiChina, Xinnet, and DNSPod domain names.
- Domain name detection: Run the nslookup-type=cname [Your domain name] command in the command-line interface of your operating system (Linux, Mac, or Windows).
If “command not found” is displayed in a Linux operating system (such as CentOS), run the yum install bind-utils -y command to install the required package.
If the canonical name displayed in the command output is the same as the CNAME value displayed in the ApsaraVideo for VOD console, the configuration is successful.
Video files uploaded to ApsaraVideo for VOD must be processed before they can be played. Video file processing modes include Transcoding and No Transcoding. You can select the appropriate processing mode based on the business needs. The uploaded mezzanine files must be multimedia files that meet the file format and encoding requirements. Otherwise, they cannot be transcoded for playback.
For more information about the restrictions on file formats, see supported file formats in the video upload overview. If you choose to distribute video files without transcoding, ApsaraVideo for VOD needs to take snapshots of the videos and perform CDN acceleration for distribution. To ensure that the distributed mezzanine files can be played by default, you can upload only MP4, MP3, and FLV files.
If the uploaded mezzanine files do not meet the file format and encoding requirements, file transcoding fails. Currently, most transcoding failures occur when the uploaded mezzanine files are not video files or are invalid video files or the metadata is incorrect in the uploaded mezzanine files. Before uploading a mezzanine file, ensure that it can be played locally.
On the Transcode page of the ApsaraVideo for VOD console, select a transcoding template group. By default, the No Transcoding and system template groups are available after ApsaraVideo for VOD is activated. For more information, see Transcoding settings. When the transcoding process is triggered, ApsaraVideo for VOD transcodes the mezzanine files to the specified formats and definitions for playback based on your transcoding configuration. If you select the No Transcoding template group, the mezzanine files can be played immediately after they are uploaded.
After video files are processed, only videos whose Status is Normal can be played. To quickly determine whether the current video can be played, you can query the status of videos cyclically or configure event notifications that are sent when videos can be played. The time required for querying video status is unpredictable. We recommend that you configure event notifications based on the video file processing mode:
Transcoding: A video processed in this mode can be played immediately when transcoding in one definition is completed. For this processing mode, you can configure the StreamTranscodeComplete and TranscodeComplete events. The two events are generated when a single stream is transcoded and when all streams are transcoded, respectively.
No Transcoding: A video processed in this mode can be played immediately when it is uploaded. For this processing mode, you can configure the FileUploadComplete event.
ApsaraVideo for VOD provides a comprehensive content security protection mechanism to meet the security requirements in different business scenarios. However, improper security configuration may lead to video playback failures.
Videos in the Checking status exist only when the review process is set to Review Before Publish.
Videos in the Blocked status exist only after you block videos. You can block videos by clicking Blocked on the Video review details page of the ApsaraVideo for VOD console or by calling the review operation.
Videos in the Checking or Blocked status can be played only in the ApsaraVideo for VOD console or from IP addresses that have been added to review security groups.
You can configure a referer blacklist or whitelist (but not both) on the hotlinking protection page to restrict access to video resources. If a request meets the rules, video data is returned. If a request does not meet the rules, it is rejected and HTTP response code 403 is returned. For more information, see Hotlinking protection.
If fixed playback URLs are used, unauthorized video distribution may occur and cannot be effectively controlled. ApsaraVideo for VOD provides the URL signing feature. This feature generates dynamic and encrypted URLs (containing information such as permission verification and validity period) to identify valid requests and protect video resources. You can configure URL signing on the URL Authentication page. For more information, see URL signing.
After URL signing is enabled, ApsaraVideo Player SDKs and the API or SDKs for obtaining playback URLs automatically generate playback URLs with a validity period.
After URL signing is enabled, the URLs of all media resources, including videos, audio, thumbnails, and snapshots, need to be signed.
After URL signing is enabled, videos can be played only when the playback URLs are within the validity period. Requests for expired playback URLs are rejected, and HTTP response code 403 is returned.
Alibaba Cloud video encryption service encrypts video data. Video files downloaded to a local device are encrypted, preventing unauthorized redistribution. If you have enabled HLS encryption when configuring a transcoding template, stream files transcoded by using the transcoding template can be played only by ApsaraVideo Player SDK. Currently, ApsaraVideo Player SDK can automatically decrypt and play encrypted videos on multiple platforms, including iOS, Android, and Flash. HTML5 players cannot play encrypted videos.
For more information, see Alibaba Cloud video encryption.
Audio and video playback is strongly dependent on the network environment. If the network environment is unstable, the playback quality is seriously affected, or even videos cannot be played. When a network exception occurs, you can refer to the following two network troubleshooting methods:
When you visit https://en.ipip.net/ip.html, the local IP address is displayed by default.
You can ping the required domain name locally, and check whether the IP address matching the domain name is resolved.
Check whether the resolved IP address is that of an Alibaba Cloud CDN node. You can enter the IP address at https://en.ipip.net/ip.html to check the region.
If the IP address is not that of an Alibaba Cloud CDN node, the domain name is hijacked. We recommend that you submit a complaint to your network operator.
If the resolved IP address is that of an Alibaba Cloud CDN node and the domain name can be pinged, check whether the problem is caused by the origin. To do so, bind the IP address to the domain name in the local hosts file and visit the domain name. For more information, see the procedure for rectifying an Alibaba Cloud CDN access fault.
Videos cannot be uploaded or played. In this case, check whether you have overdue payments in ApsaraVideo for VOD.
Videos can be played in the ApsaraVideo for VOD console. However, when you call the API or SDK to obtain a playback URL, the error InvalidDomain.NotFound is returned. In this case, check the
domain name configuration.
When you call the API or SDK to obtain a playback URL, the error Forbidden.IllegalStatus is returned. In this case, check the video status.
When you call the API or SDK to obtain a playback URL, the error InvalidVideo.NotFound is returned. In this case, check whether the video has been deleted.
When you visit a CDN URL, HTTP response code 403 is returned. In this case, check the
Users in a certain region cannot play videos. In this case, check the
You can locate playback problems by using the web player diagnosis page for ApsaraVideo for VOD. Currently, native HTML5 players and Alibaba Cloud HTML5 or Flash players are supported. Diagnosis page URL: http://player.alicdn.com/detection.html?source=http://common.qupai.me/player/qupai.mp4