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.
- Log on to the ApsaraVideo VOD console.
- In the left-side navigation pane, choose Media Files > Audio/Video.
- Obtain the video IDs in the video list.
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.
- Log on to the ApsaraVideo VOD console.
- Move the pointer over the profile picture in the upper-right corner and select AccessKey Management.
- 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?
- Log on to the ApsaraVideo VOD console.
- In the left-side navigation pane, choose . On the Download page, turn on Download. In the Turn on the download function dialog box, select Encrypted and click OK.
- In the Get the key section, set the Unique App Identifier and Private Key parameters.
- 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. |
- Obtain the playAuth: You can use the playback authentication SDK on the server to obtain the playAuth from ApsaraVideo VOD.
- 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.