ApsaraVideo VOD provides an offline download feature for mobile scenarios. You can enable this feature to allow end users to cache videos on their local devices for offline viewing.
Download modes
ApsaraVideo VOD provides a video download feature for mobile scenarios. You can choose between two download modes: secure download and standard download. The differences are described below:
Secure download (Recommended): Allows end users to cache videos on their local devices for viewing with ApsaraVideo Player for mobile. The downloaded video files are encrypted with a generated key file. These files can only be decrypted and played by ApsaraVideo Player. The videos cannot be viewed with third-party players or without decryption.
Standard download: Allows end users to cache videos on their local devices for viewing with ApsaraVideo Player for mobile. The downloaded video files are not encrypted. They can be copied and played with any player. Use this mode with caution.
Secure download ensures that downloaded videos are encrypted and can be played only by a specified application. You can specify an application by providing its unique ID when you generate a key file in the ApsaraVideo VOD console. This mode is more secure and reliable than standard download. It is ideal for scenarios that require video copyright protection. We recommend that you use secure download in most scenarios.
Limits
The offline download feature is integrated into the ApsaraVideo Player SDK. To use this feature, you must integrate the ApsaraVideo Player SDK and complete the code configurations. All ApsaraVideo Player SDKs support offline download except for ApsaraVideo Player SDK for web. For more information about the configuration methods, see the following topics:
Enable offline download
Enable standard download
After you enable standard download, end users can use ApsaraVideo Player for mobile to cache videos on their local devices for offline viewing. The downloaded video files are not encrypted. They can be copied and played in any player. Use this mode with caution.
Log on to the ApsaraVideo VOD console.
In the navigation pane on the left, choose Configuration Management > CDN Configuration > Download Settings.
Turn on the switch for the download feature. If the feature is already enabled, click Modify. Set Download Mode to Normal Download, and then click OK.
Enable secure download
After you enable secure download, end users can use ApsaraVideo Player for mobile to cache videos on their local devices for offline viewing. The downloaded video files are encrypted with a generated key file. They can be decrypted and played back only in ApsaraVideo Player and cannot be viewed in third-party players.
Log on to the ApsaraVideo VOD console.
In the navigation pane on the left, choose Configuration Management > CDN Configuration > Download Settings.
Turn on the switch for the download feature. If the feature is already enabled, click Modify. Set Download Mode to Secure Download, and then click OK.
In the Get the key area, enter the unique app ID and the offline decryption private key, and then click Generate and Download Key.
After you configure secure download, offline videos must be decrypted with a key before they can be played.
The offline video encryption private key is a binary file that is generated based on the unique app ID and offline decryption private key that you enter. The key is generated using a private algorithm and is available for download. After you download the key, securely save it in the client application. The ApsaraVideo Player SDK uses the key during the offline video download and playback process.
NoteYou can generate multiple keys for different clients.
Parameter name
Description
Unique app ID
Android: The SHA-1 value of the keystore file. The obtained SHA-1 value must be a string with colons.
iOS: The App Bundle ID.
Windows: The serial number of the digital signing certificate.
For more information about how to obtain the unique app ID, see Obtain the unique app ID.
Offline decryption private key
A custom private key string. The string must be 16 to 32 characters in length and contain a combination of letters and digits. It must include uppercase letters, lowercase letters, and digits.
Save the generated key file to the client application and configure the key file in the ApsaraVideo Player SDK.
For more information about the configuration methods, see the following topics:
Obtain the unique app ID
Android
The signature information of an Android application is the SHA-1 value of the keystore file. You can use the signingReport feature of Android Studio to generate a signing report and obtain the signature information.
iOS
This is the Bundle ID of the iOS application.
Disabling video when offline
After you enable the offline download feature, you can disable offline download for specific videos. This prevents the videos from being downloaded using ApsaraVideo Player.
You can disable offline download for a video only when the video is in the Normal state.
This feature prevents videos from being downloaded only using ApsaraVideo Player. It does not prevent downloads from other browsers or third-party players.
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose Media Files > Audio/Video.
In the Actions column of the target video, click More and select Disable Download.
In the dialog box that appears, click OK.
References
For more information about how to download media assets in ApsaraVideo VOD, see Download media files.