All Products
Search
Document Center

Use playback URLs

Last Updated: Jul 11, 2019

Overview

You can obtain the playback URL of a video and play the video in a player. Currently, ApsaraVideo Player can directly play a video from a playback URL. You can also use the player came with your operating system, an open-source player, or your self-developed player.

Playback process

Obtain playback URLs

The server must have the AccessKey of a RAM user and be granted the playback permission. For more information, see Account permissions.

If you are using ApsaraVideo Player, see ApsaraVideo Player SDK.

Methods for obtaining playback URLs

You can obtain playback URLs from event notifications that are sent when transcoding is completed or by using the API or SDK.

From event notifications

Obtain playback URLs from event notifications that are sent when transcoding is completed. Save the playback URLs on your server so that players can access the server to obtain the playback URLs.

Instructions

  • The playback URLs obtained from event notifications are fixed URLs. If you have enabled URL signing, you must generate playback URLs with authentication keys (auth_key). Otherwise, video playback fails.

  • If you have disabled or deleted the old domain name, replace the domain name in the saved playback URL with the new one. Otherwise, video playback fails.

  • If you have configured video encryption, players must decrypt the returned playback URL to play videos.

StreamTranscodeComplete

A StreamTranscodeComplete event is generated after a video is transcoded in a single definition.

TranscodeComplete

A TranscodeComplete event is generated after a video is transcoded in all definitions.

By using the API or SDK

Instructions

To obtain playback URLs by using the API or SDK of ApsaraVideo for VOD, you must keep the video IDs returned when you upload audio or video files.

API reference:

We recommend that you use a server SDK to obtain playback URLs by calling the API. This method is simple and efficient. For more information, see the SDK example for each API operation. You can also generate HTTP or HTTPS requests by referring to Common parameters and Call example.

Restrictions

  • To ensure that the latest transcoded stream is played each time, the GetPlayInfo operation returns only the latest transcoded stream in each definition and format by default. When calling the GetPlayInfo operation, you can set ResultType to Multiple to obtain the playback URLs of all the transcoded streams of the audio or video.

  • If you have encrypted videos in Alibaba Cloud video encryption mode, only ApsaraVideo Player SDKs can play the videos. To ensure video security, the system does not return the playback URL of a stream encrypted in Alibaba Cloud video encryption mode by default when you call the GetPlayInfo operation. You can set ResultType to Multiple to obtain the playback URLs of all the transcoded streams.

  • If you have encrypted videos in standard HLS encryption mode, the system preferentially returns the playback URL of a stream transcoded in standard HLS encryption mode by default.