All Products
Search
Document Center

ApsaraVideo VOD:Use playback credentials to play videos

Last Updated:Jan 19, 2021

ApsaraVideo Player SDK can automatically obtain playback URLs based on playback credentials. This method is easy to use and makes the playback more secure. You can obtain playback credentials by calling the API operations and use the player SDK to play the video. This topic describes the playback process, instructions, and usage notes of a playback credential.

Playback process

Usage notes

  • By default, a playback credential is valid for 100 seconds and up to 3,000 seconds. You can use the playback credential to obtain the playback URL for only the specified video. The playback credential cannot be reused or used to obtain the playback URL of a video other than the specified one. You cannot obtain the playback URL of a video by using a credential that has expired. A new credential is required.

  • When URL authentication is enabled, the validity period of a playback credential is different from the validity period of a playback URL. The validity period of a playback URL can be configured without an upper limit.

  • A playback credential (PlayAuth) is not a playback URL. ApsaraVideo Player SDK can automatically obtain playback URLs based on the playback credential to play the video. However, you must obtain a new credential after the existing credential expires.

  • If videos are encrypted in Alibaba Cloud video encryption mode, only ApsaraVideo Player SDK can play the videos.

Obtain the playback credential

You can call the GetVideoPlayAuth operation to obtain the playback credential.

Call methods:

  • 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 API operations, see SDK examples for each API operation.

  • For more information about how to generate HTTP or HTTPS requests, see Common parameters and Examples.

Use ApsaraVideo Player SDK to play a video

ApsaraVideo Player SDKs for Web, Android, and iOS are provided. These SDKs can use a playback credential to automatically obtain the playback URL to play the video. For more information, see the following topics.

Notice

A playback credential has a validity period. You cannot obtain the playback URL of a video by using a credential that has expired. A new credential is required.