目录

About This Kit

Digital Rights Management (DRM) Kit provides digital rights protection services, offering capabilities for authorizing and decrypting DRM-encrypted content. It includes features such as DRM plugin management, certificate management, license management, content authorization, and content decryption, enabling the integration of DRM solutions, certificate provisioning, and content authorization and decryption.

Capabilities

Through DRM Kit, DRM solution integrators can implement DRM solution integration, whereas application developers can call the corresponding DRM solutions to authorize and decrypt DRM-encrypted content, enabling playback of DRM-protected media.

DRM certificate management, license management, content authorization, and content decryption depend on the implementation of the corresponding DRM solutions. Application developers can extend support for additional media protocols, container formats, and audio/video encoding formats.

Features

Basic Concepts

Before you start, understand the following key concepts:

Workflow

DRM plugin management is typically implemented by DRM solution integrators.

The following figure illustrates the workflow for integrating DRM Kit into an application.

The workflow includes:

  1. Creating MediaKeySystem and MediaKeySession instances: The application obtains the DRM information of the content and creates MediaKeySystem and MediaKeySession instances based on the solution UUID in the DRM information. The DRM information can be obtained from service-provided DRM descriptions, or from the mediaKeySystemInfoUpdate event or MediaKeySystemInfo callback provided by Media Kit or AVCodec Kit.

  2. Certificate provisioning: During the creation of a MediaKeySession instance, if no DRM certificate is available or the certificate is invalid, DRM Kit triggers an event requiring certificate provisioning (keySystemRequired). The application can then call certificate provisioning APIs of MediaKeySystem to complete the process. Alternatively, the application can check the DRM certificate status according to the DRM solution's requirements and proactively call the provisioning APIs if no valid certificate is available. This step can be skipped if the DRM solution has a valid certificate or does not require provisioning.

  3. License acquisition: The application calls license-related APIs of MediaKeySession using the PSSH data from DRM events to request and process DRM licenses.

  4. DRM content decryption: The application sets the MediaKeySession in Media Kit or AVCodec Kit to support DRM content decryption. When using AVCodec Kit, the application can set the cencInfo for audio/video data frames in AVBuffer, enabling decryption and decoding when calling PushInputBuffer.

  5. License update or expiration: During playback, if a license needs updating, MediaKeySession triggers a license update event (keyRequired), requiring the application to request a new DRM license. If MediaKeySession triggers a license expiration event (keyExpired), DRM content playback must be stopped.