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.
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.
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.
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.
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.