Configure DRM encryption

更新时间:
复制 MD 格式

This topic describes how to apply DRM encryption to videos in ApsaraVideo VOD and play them using ApsaraVideo Player SDK.

Limitations

You can enable DRM encryption only in the ApsaraVideo VOD console.

Billing

DRM encryption uses the pay-as-you-go billing method with no minimum fees. Charges consist of two parts:

Charge typeWhen charged
Transcoding feeWhen a video is transcoded with DRM encryption enabled.
License feeEach time a device requests a license to play a DRM-encrypted video.

For pricing details, see DRM encryption.

DRM encryption compatibility

DRM solution

Mobile

Browser

Widevine

Android

Chrome, Firefox (47+), Edge, Opera

FairPlay

iOS

Safari

Apply DRM encryption

Step 1: (Optional) Apply and upload DRM certificate

Note

To protect content for iOS devices with FairPlay, you must apply for and upload a FairPlay certificate. You can skip this step if you only need to protect content for Android devices by using Widevine.

  1. Apply for a FairPlay certificate.

    For more information, see Apply for a FairPlay Streaming certificate.

  2. Upload the FairPlay certificate.

    1. Log on to the ApsaraVideo VOD console.

    2. In the left-side navigation pane, choose Configuration Management > Media Processing > DRM Certificates.

    3. Click Upload Certificate.

      Parameter

      Description

      Certificate Name

      A name for the certificate, 2 to 32 characters in length.

      Content

      The FairPlay certificate file. Only files with the .cer extension are supported.

      Private Key

      The password-protected private key that you created when applying for the certificate.

      Passphrase

      The key used to decrypt the private key. It must be 1 to 32 characters long and can contain letters and digits.

      ASk

      The Application Secret Key (ASk) from Apple. It must be 1 to 32 characters long and can contain letters and digits.

    4. Click OK.

Step 2: Create a DRM transcoding template group

  1. Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups.

  2. On the Transcoding Template Groups page, click Create Transcoding Template Group to create a DRM-enabled transcoding template group.

    You can enable DRM encryption in both regular transcoding templates and video packaging templates. The following steps show how to enable DRM encryption in a regular transcoding template:

    • In the Basic information section, set Encapsulation Format to HLS.

    • In the Advanced Parameters section, enable Video Encryption and select DRM Encryption.

    • Configure other parameters as needed. For detailed parameter descriptions, see Transcoding templates.

  3. Click Save.

    Save this ID. You will need it to start a DRM encryption job.

Step 3: (Optional) Create a workflow for DRM transcoding

You can use a workflow to orchestrate media processing tasks such as transcoding, content review, and snapshotting in a specific order. When you trigger the workflow during media upload or processing, it automatically processes the media file according to the predefined steps.

You can add a transcoding node that uses your DRM-enabled transcoding template group to a workflow. Currently, you can create workflows only in the ApsaraVideo VOD console. For more information, see Workflows.

Step 4: Start a DRM transcoding job

You can trigger transcoding both during and after a video upload. You can start a job by using a transcoding template group directly or by using a workflow that includes a transcoding node.

Currently, you can trigger DRM-encrypted transcoding only by using a transcoding template group and a workflow during video upload, or by using a workflow after video upload. Using a transcoding template group to trigger DRM-encrypted transcoding after a video is uploaded is not supported. For detailed instructions on how to initiate transcoding, see Audio and video transcoding for the console method and Audio and video transcoding for the OpenAPI method.

Step 5: Check the job result

Receive event notifications

If you have configured event notifications for ApsaraVideo VOD, ApsaraVideo VOD sends task information in the SingleStreamTranscodeComplete or TranscodeComplete callback messages. For more information about how to configure event notifications, see Event Notification.

Query the job status

Use the console

  1. Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video.

  2. On the Audio/Video page, check the Status of the target video.

    If the Status is Normal, the DRM encryption and transcoding job was successful.

  3. Click Manage in the row of the video.

  4. Click the Video URL tab. ApsaraVideo VOD marks successfully encrypted streams with DRM Encryption.

Use the API

Call the GetPlayInfo operation and set the ResultType parameter to Multiple to retrieve all transcoded streams for the video. The EncryptType parameter in the response indicates the encryption type of each stream.

Play a DRM-encrypted video

DRM-encrypted videos can only be played by using ApsaraVideo Player SDK.

ApsaraVideo Player SDK is available for multiple platforms, including iOS, Android, and web (HTML5 and Flash). You can integrate the SDK into your applications or websites to enable the playback of DRM-encrypted videos.

When you use ApsaraVideo Player SDK to play DRM-encrypted videos, note the following:

  • You must use ApsaraVideo Player SDK version 5.2.1 or later. FairPlay is supported on iOS, and Widevine is supported on Android.

  • Before you use ApsaraVideo Player SDK, you must obtain a player license. For more information, see Obtain a license.

  • Before you integrate ApsaraVideo Player SDK, review the DRM compatibility for each platform. For more information, see Compatibility of ApsaraVideo Player SDK.

  • For instructions on playing DRM-encrypted videos with ApsaraVideo Player SDK, see the playback guide for your target platform: Play an encrypted video, Play an encrypted video, and Play an encrypted video.

  • Operations such as rotate, mirror, and screenshot are not supported during playback of high-security content like DRM-encrypted videos.

FAQ