All Products
Search
Document Center

Use playback credentials

Last Updated: Sep 17, 2019

Overview

ApsaraVideo Player can use a playback credential to automatically obtain the playback URL and play the video. This method provides greater simplicity and security. By default, a playback credential is valid for 100 seconds (up to 3,000 seconds). Use it to obtain the playback URL for the specified video only. It 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 with an expired credential. A new credential is required.

Instructions

  • The validity period of a playback credential is different from that of a playback URL (when URL signing is enabled). The validity period of a playback URL can be customized without an upper limit.
  • A playback credential (PlayAuth) is not a playback URL. ApsaraVideo Player SDKs obtain the actual playback URL based on the playback credential and play the video. However, you must obtain a new credential after an old one expires.
  • If you have encrypted videos in Alibaba Cloud video encryption mode, only ApsaraVideo Player SDKs can play the videos.

Playback process

Playback process

Obtain a playback credential

You can obtain a playback credential by using the API of ApsaraVideo for VOD. API reference:

We recommend that you use a server SDK to obtain playback credentials 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.

Use ApsaraVideo Player SDKs to play videos

ApsaraVideo Player SDKs for web, Android, and iOS are provided. All of them can use a playback credential to automatically obtain the playback URL and play the video. For more information, see the reference document for your player, as described in the following table.

Web (HTML5 or Flash) Android iOS
For more information, see playback method 2 in SDK usage. For more information, see playback method 3 in Prepare for playback. For more information, see playback method 3 in Prepare for playback.

Note: A playback credential has a validity period. You cannot obtain the playback URL of a video with an expired credential. A new credential is required.