ApsaraVideo VOD allows you to play audio and video files by using playback URLs. You can obtain playback URLs from event notifications that are sent when transcoding is complete or by using the API or SDK that is used to obtain playback URLs. This topic describes the process, method to obtain the URL, and instructions of playback.
The server must have the AccessKey of a RAM user and must be granted the playback permission. For more information, see Overview.
If you use ApsaraVideo Player, see Use ApsaraVideo Player.
Obtain the playback URL
You can obtain playback URLs from event notifications or by using the API or SDK that is used to obtain playback URLs.
You can obtain the playback URL by receiving the StreamTranscodeComplete or TranscodeComplete event notification. After you save the event notification to your own server, you can access your own server to obtain the stored playback URL when you play audio and video files.
The playback URLs that are obtained from event notifications are
fixed URLs. If URL authentication is enabled, you must generate playback URLs that have authentication keys (auth_key). If you do not generate the playback URLs, video playback fails.
If the old domain name is disabled or deleted, replace the domain name in the saved playback URL with a new domain name. If you do not replace the domain name, video playback fails.
If video encryption is configured, players must decrypt the returned playback URL to play videos.
To obtain playback URLs by calling the GetPlayInfo operation or by using the ApsaraVideo VOD API or SDK, you must keep the video IDs returned when you upload audio or video files.
We recommend that you use a server SDK to obtain media asset information by calling the API operations. This method is simple and efficient. For more information, see Usage notes. For more information about APIs, see SDK examples for each API operation.
By default, the GetPlayInfo operation returns only the latest transcoded stream in each definition and format to ensure that the latest transcoded stream is played each time. When you call the GetPlayInfo operation, you can set
Multipleto obtain the playback URLs of all the transcoded streams of the audio or video.
If videos in Alibaba Cloud video encryption mode are encrypted, only ApsaraVideo Player SDK can play the videos. By default, the system does not return the playback URL of a stream that is encrypted in Alibaba Cloud video encryption mode when you call the GetPlayInfo operation. This ensures video security. You can set
Multipleto obtain the playback URLs of all the transcoded streams.
By default, if videos in HLS Encryption mode are encrypted, the system preferentially returns the playback URL of a stream that is transcoded in HLS Encryption mode.
You can obtain and send the playback URL of a video to your player.
ApsaraVideo Player can directly play a video by using a playback URL. For more information, see Use ApsaraVideo Player.
You can also use the player that is built in the system, an open source player, or your self-developed player.