This topic describes how to enable digital rights management (DRM) encryption in the ApsaraVideo VOD console, including how to upload a certificate, configure settings in the console, and configure ApsaraVideo Player.

Limits

You can enable DRM encryption only by using the ApsaraVideo VOD console.

Upload a certificate

Note If you develop applications that run on iOS or Android, you must upload a FairPlay Streaming certificate to the ApsaraVideo VOD console.
  1. Apply for a FairPlay Streaming certificate from Apple. For more information, see Apply for a FairPlay Streaming certificate.
  2. Log on to the ApsaraVideo VOD console.
  3. In the left-side navigation pane, click Configuration Management.
  4. Choose Media Processing > DRM Certificates to go to the DRM Certificates page.
  5. Click Upload Certificate.
    002
    Set the parameters that are described in the following table.
    Parameter Description
    Certificate Name The name of the certificate. The name must be 2 to 128 characters in length.
    Content The FairPlay Streaming certificate. Only .cer files are supported.
    Private Key The password-protected private key created when you apply for the FairPlay Streaming certificate.
    Passphrase The key that is used to decrypt the private key. A passphrase must be 1 to 32 characters in length and can contain letters and digits.
    ASk The Application Secret key (ASk). The ASk is provided by Apple for you when you apply for the FairPlay Streaming certificate. An ASk must be 1 to 32 characters in length and can contain letters and digits.
  6. Click OK.

Enable DRM encryption in the ApsaraVideo VOD console

  1. Log on to the ApsaraVideo VOD console.
  2. In the left-side navigation pane, click Configuration Management.
  3. Choose Media Processing > Transcoding Template Groups.
  4. Click Create Transcoding Template Group.
    003
  5. On the Create Transcoding Template Group page, click Add Template below Normal Transcoding Template.
  6. In the Basic Parameters section, select hls from the Encapsulation Format drop-down list.
  7. Click the Show icon on the left of Advanced Parameters. Turn on Video Encryption and select DRM Encryption for the Encryption Method parameter.
    005

View videos transcoded by using DRM encryption-enabled templates

When you upload a video by using the ApsaraVideo VOD console, API, or upload SDK, use a template for which DRM encryption is enabled to transcode the video. After the video is transcoded, choose Media Files > Audio/Video in the console. Find the transcoded video and click Manage in the Actions column. On the management page of the video, click the Video URL tab to view the information about the video. The DRM Encryption label is displayed in the Format column if the video is transcoded by using a DRM encryption-enabled template.

DRM Encryption

Play a DRM-encrypted video

To play DRM-encrypted videos, you must use ApsaraVideo Player to facilitate your development. Before you use ApsaraVideo Player to play DRM-encrypted videos, you must configure the following settings:
  • The version of ApsaraVideo Player must be V5.2.1 or later. You can use FairPlay DRM encryption for iOS and Widevine DRM encryption for Android.
  • If you use ApsaraVideo Player for iOS, you must call the setFairPlayCertID method of AliPlayerGlobalSettings to specify the ID of your FairPlay Streaming certificate. This method needs to be called only once. To obtain the ID of your FairPlay Streaming certificate, log on to the ApsaraVideo VOD console. Choose Configuration Management > Media Processing > DRM Certificates. Then, find your certificate ID on the DRM Certificates page.
  • If you use ApsaraVideo Player for Android, we recommend that you use SurfaceView to play videos with high security levels.
Note Mobile and web clients are supported. When you play a video with a high security level, you cannot rotate the video, mirror the video, or take snapshots from the video.