This topic describes specific key parameters for ApsaraVideo VOD.

What is a video ID? Why is a video ID required? How can I obtain a video ID?

For security purposes, ApsaraVideo VOD provides you with a video ID instead of a video URL after you upload a video file. For more information about how to obtain a video URL by calling an operation of the ApsaraVideo VOD API, see GetPlayInfo.

After you upload a video to ApsaraVideo VOD, you can obtain a video ID.

You can also view video IDs in the ApsaraVideo VOD console. Perform the following steps to view the video IDs:
  1. Log on to the ApsaraVideo VOD console.
  2. In the left-side navigation pane, choose Media Files > Audio/Video.
  3. Obtain the video IDs in the video list.
You can use the video IDs that you obtain in the ApsaraVideo VOD console to test the download and playback features. For more information about how to upload videos to ApsaraVideo VOD, see Overview.

What are AccessKey ID and AccessKey secret? How can I obtain an AccessKey ID and an AccessKey secret?

The AccessKey ID and AccessKey secret are the only credentials that you can use to call Alibaba Cloud APIs. The AccessKey ID is used to identify you as a user. The AccessKey secret is used to encrypt the signature string of your access request. This can prevent data from being tampered with. The AccessKey secret is similar to a logon password. Keep the AccessKey secret confidential.

Perform the following steps to obtain the AccessKey ID and AccessKey secret:
  1. Log on to the ApsaraVideo VOD console.
  2. Move the pointer over the profile picture in the upper-right corner and select AccessKey Management.
  3. On the AccessKey Management page, create an AccessKey pair or view the AccessKey secret of an existing AccessKey ID.

What is a playKey? How can I obtain a playKey?

A playKey is an API key. It is used for authentication when ApsaraVideo Player SDK obtains the streaming URL of a video. Playback authentication is a secondary authentication mechanism that is implemented by ApsaraVideo VOD based on Alibaba Cloud AccessKey authentication. The playKey can prevent hotlinking. By default, ApsaraVideo VOD provides playKeys for Flash, HTML5, iOS, and Android to meet your video playback needs.
Note To ensure security, if you want to view your playKey, you must enter the verification code that is sent to your mobile phone.
Perform the following steps to obtain the playKey:
  1. Log on to the ApsaraVideo VOD console.
  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Download. On the Download page, turn on Download. In the Turn on the download function dialog box, select Encrypted and click OK.
  3. In the Get the key section, set the Unique App Identifier and Private Key parameters.
  4. Click Generate and Download Key.

What is a playAuth? How can I obtain a playAuth?

ApsaraVideo Player plays videos in three modes that apply to different scenarios. Among the three modes, the setAuthInfo method is the most secure mode, in which a playAuth is provided.

A playAuth is a playback credential in which the video ID, AccessKey ID, and AccessKey secret are packaged and encrypted. After you obtain the playAuth, you can obtain a string of data that contains various information for ApsaraVideo Player to play videos.

Playback mode Scenario Advantage and disadvantage Recommended
setDataSource This mode is used for testing. Risky. You must fix your AccessKey pair to your client. If the client is cracked, your AccessKey pair may be leaked. Not recommended for commercial use.
setAuthInfo This mode is available for commercial use. Secure. All video URLs and links are not exposed. Recommended for commercial use.
Playback of local videos and online videos In this mode, local videos can be played and videos can be played based on video URLs. Simple. Videos on other platforms can be played. Used for playing local videos and online videos.
Procedure: The server obtains playAuth, the server sends the playAuth to the client, and then the client plays the video. > >
  1. Obtain the playAuth: You can use the playback authentication SDK on the server to obtain the playAuth from ApsaraVideo VOD.
  2. Play a video: ApsaraVideo Player SDK obtains the streaming URL of the video from ApsaraVideo VOD based on the video ID and playAuth. Then, ApsaraVideo Player SDK loads and decodes the video stream, and plays the video.

A playAuth is valid for 100 seconds. It is used only to obtain the streaming URL of the specified video and cannot be used for other videos or reused. If the playAuth expires, you cannot obtain the streaming URL. In this case, you must obtain the playAuth again.

ApsaraVideo Player SDK automatically obtains the streaming URL for decoding and playback based on the playAuth. The streaming URL is valid for 30 minutes. If the playAuth expires, obtain the playAuth again and send it to ApsaraVideo Player SDK to refresh the streaming URL.

To ensure the security of your Alibaba Cloud account, we recommend that you use the AccessKey pair of a RAM user, especially when you use ApsaraVideo Player SDK for web.