ApsaraVideo VOD allows you to download videos to your mobile devices for offline playback. You can enable the download feature based on your business requirements. This way, users can cache videos for offline playback.
Download modes
ApsaraVideo VOD supports video download to mobile devices for offline playback. The normal download and secure download modes are supported. The following content describes the differences between the two modes:
Secure download (recommended): Videos that are downloaded in this mode are encrypted by Alibaba Cloud. You must use key files to decrypt the videos before you play them. Videos can be played only by using ApsaraVideo Player.
Normal download: Videos that are downloaded in this mode are not encrypted by Alibaba Cloud and can be copied and played by using any player. Exercise caution when you use the normal download mode.
Secure download ensures that videos that you download are encrypted. You can play the encrypted videos only by using the app that you specified when you generate the key file in the ApsaraVideo VOD console. Compared with the normal download mode, the secure download mode is more reliable and suitable to protect the copyright of downloaded videos. In most cases, we recommend that you use the secure download mode.
Limits
To use the secure download feature, you must integrate ApsaraVideo Player SDK and configure code builds. ApsaraVideo Player SDK for Web does not provide the download feature. For more information about how to configure the download feature in ApsaraVideo Player SDK for other clients, see the following topics:
Enable offline download
Enable normal download
If you use the normal download mode, users can use ApsaraVideo Player to cache videos for offline playback on mobile devices. The downloaded videos are not encrypted by Alibaba Cloud and can be copied and played by any players. Exercise caution when you use the normal download mode.
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose .
On the page that appears, enable the download feature. In the dialog box that appears, set Download Mode to Normal Download, and click OK. If you have enabled the download feature, click Modify to change the download mode.
Enable secure download
If you use the secure download mode, users can use ApsaraVideo Player to cache videos for offline playback on mobile devices. The downloaded videos are encrypted by using a key file and can be decrypted only by using the same key file. The videos cannot be played by third-party players or without being decrypted. The videos can be played only by ApsaraVideo Player.
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose .
On the page that appears, enable the download feature. In the dialog box that appears, set Download Mode to Secure Download, and click OK. If you have enabled the download feature, click Modify to change the download mode.
In the Get the key section, enter the unique identifier of the app and the private key for offline decryption, and click Generate and Download Key.
If you use the secure download mode, the downloaded video can be played only after the video is decrypted.
The encryption key is a binary file. To generate and download the key file, you must enter the unique identifier of your app and the private key that is generated by using the proprietary cryptography algorithm for decryption. You must save the downloaded private key file on the client app. This way, ApsaraVideo Player SDK can use the file for download and playback.
NoteYou can generate multiple keys for different clients.
Parameter
Description
Unique App Identifier
Android: the SHA-1 fingerprint of the keystore. The value is a string that contains a colon (:).
iOS: the bundle ID of the app.
Windows: the serial number in the digital signature certificate.
For more information about how to obtain the unique identifier of an app, see Obtain the unique app identifier.
Private Key
A custom string of 16 to 32 characters in length. The string must contain uppercase letters, lowercase letters, and digits.
Save the generated key file to the client app and configure the key file in ApsaraVideo Player SDK.
For more information about how to configure the key file, see the following topics:
Obtain the unique app identifier
Android
The signature information of an Android app is the SHA-1 fingerprint of the keystore. You can run the signingReport task in Android Studio to obtain the signature information.
iOS
The unique identifier of an iOS app is the bundle ID of the app.
Windows
Run the exe
program of ApsaraVideo Player SDK for Windows to obtain the serial number in the digital signature certificate.
References
For more information about how to download media files in ApsaraVideo VOD, see Download media files.