This topic describes some important parameters in ApsaraVideo VOD.
What is a videoID? Why is a videoID required? How do I get a videoID?
For security reasons, when you upload a media file to ApsaraVideo VOD, you receive a video ID (videoID) instead of a URL. You can also obtain a videoID using the OpenAPI. For more information, see Get audio and video playback URLs.
A videoID is returned after you upload a file to ApsaraVideo VOD.
You can also obtain a videoID in the ApsaraVideo VOD console by following these steps:
Log on to the ApsaraVideo VOD console.
In the left navigation pane, under Media Files, click Audio/Video.
In the video list, find the videoID.
You can use the videoIDs from the console to test downloads and playback. For more information about how to upload media assets, see Upload SDK overview.
What are an AccessKey ID and AccessKey secret? How do I get them?
Your Alibaba Cloud AccessKey ID and AccessKey secret are your unique credentials for accessing Alibaba Cloud APIs. The AccessKey ID identifies you, and the AccessKey secret is used to sign your access parameters to prevent them from being modified. Your AccessKey secret is similar to your logon password and must be kept confidential.
Retrieval operations:
Log on to the ApsaraVideo VOD console.
Hover over your user profile in the menu bar and click AccessKey Management in the shortcut menu.
On the AccessKey Management page, you can create an AccessKey or view the AccessKey secret for an existing AccessKey ID.
What is a playKey? How do I get it?
A playKey, also known as an API key, is a key used for playback. The player software development kit (SDK) uses the playKey for authentication when retrieving a video playback URL. Playback authentication is a secondary authentication mechanism that is built on top of the standard Alibaba Cloud AccessKey security to help prevent hotlinking. ApsaraVideo VOD provides default playKeys for Flash, H5, iOS, and Android platforms.
For security, you must enter a mobile verification code to view your playKey.
Retrieve operation:
Log on to the ApsaraVideo VOD console.
In the navigation pane on the left, under Configuration Management, choose CDN Configuration > Download Settings. Turn on secure download mode.
In the Get Key section, enter the Unique App Identifier and Private Key.
Click Generate and Download Key.
What is a playauth? How do I get it?
The player supports three video playback modes for different scenarios. The playauth method is the most secure and uses the setAuthInfo playback mode.
A playauth is a playback credential. The ApsaraVideo VOD service combines information such as the videoID, AccessKey ID, and AccessKey secret, and then encrypts this information. The result is a single string of data that the player uses for playback.
Playback mode | Scenario | Pros and cons | Recommended Usage |
setDataSource | For testing | Risk of leaks. You must write your AccessKey ID and AccessKey secret directly into the client code. If the client is cracked, your credentials could be exposed. | Not recommended for commercial use |
setAuthInfo | For commercial use | Secure. No video URLs or links are exposed. | Recommended for commercial use |
Play local and network URLs | Plays local videos and videos from a URL | Simple. Can play videos from other platforms. | Use when you need to play local videos or videos from a network URL |
Flow: The server obtains the playback credential > The server sends the credential to the client > The client plays the video.
Obtain the playback credential: On your server, call the server-side playback authentication SDK to obtain a playback credential from the ApsaraVideo VOD service.
Play the video: The player SDK uses the videoID and the playback credential to retrieve the video's playback URL from the ApsaraVideo VOD service. The SDK then loads and decodes the video stream for playback.
A playback credential is valid for 100 seconds. It can only be used to retrieve the playback URL for a specific video. It cannot be reused or used for other videos. If the credential expires, you cannot retrieve the playback URL. You must obtain a new credential.
The player SDK automatically retrieves the playback URL using the playback credential to decode and play the video. The playback URL is valid for 30 minutes. If the playback credential expires, you must obtain a new one and pass it to the player SDK to refresh the playback URL.
To protect your Alibaba Cloud account, we recommend that you use the AccessKey of a RAM user. This is especially important for web playback scenarios.