What is Huawei WisePlay Digital Rights Management — Explained

Doğan Burak Ziyanak
Huawei Developers
Published in
4 min readAug 28, 2020
Huawei WisePlay DRM

Digital rights management (a.k.a DRM) protects digital media copy rights. The purpose is to prohibit unauthorized redistribution of digital media and restrict the ways that consumers can copy purchased content.

In general, DRM systems have been implemented by embedding code that prevents copying, specifies a time period in which the content can be accessed or limits the number of devices the media can be installed on.

There are several DRM solutions on market, one of the frequently used solution is Widevine DRM provided by Google that is mainly used in Android and Google native devices.

On the other hand, for the purposes of this article, Huawei WisePlay DRM solution will be analyzed. WisePlay DRM provides royalty-free (WisePlay doesn’t charge a license fee in order to implement its protection technology), standards-based digital content copyright protection capabilities , supports both hardware and software level DRM capabilities, and builds high-quality digital content service copyright protection capabilities developers.

WisePlay DRM Architecture

Key Features of WisePlay DRM

1) Online Playback (VOD/Live TV)

The content license will be deleted when the playback session is closed.

2) Offline Playback(VOD)

The content license will be stored in the device.

3) Hardware and Software Level DRM

WisePlay DRM supports both hardware and software level encryption capabilities.

The difference between hardware-level and software-level encryption capabilities lies in device security level. Most of the service providers requires hardware-level DRM capability for the high quality e.g. 4K video media content for data protection.

The Trusted Application (a.k.a TA) running at the Trusted Execution Environment (a.k.a TEE) layer is required for the hardware-level encryption capability. The TA running at the TEE layer is not required for the software-level encryption capability and encryption depends on device chip capabilities.

According to software-level DRM capability, data encryption and other operations are performed at the Rich Operating System Execution Environment (a.k.a REE) layer. Content security is protected by software.

4) Supports Multiple Content Formats

WisePlay DRM provides most frequently used adaptive streaming content formats:

  • fMP4 DASH
  • fMP4 HLS
  • TS HLS

5) Supports Multiple Encryption Algorithms

WisePlay DRM provides most frequently used adaptive streaming content formats:

  • CENC
  • AES128-CTR
  • AES128-CBC

Development Scenarios

1) Obtain Online License

  • Call isCryptoSchemeSupported() method to check whether the UUID of WisePlay DRM is supported.
  • Create a MediaDrm object and transfer the UUID of WisePlay DRM. The UUID indicates the globally unique ID of each DRM type. (Note: Wiseplay DRM UUID = 3d5e6d35–9b9a-41e8-b843-dd3c6e72c42c)
  • Call the openSession() method of MediaDrm to open a session and obtain sessionId.
  • Call getKeyRequest() of MediaDrm to obtain the KeyRequest object in the license request body. The input parameters are described as follows:

sessionId: session ID returned by the openSession method.

initData:

a) If KeyType is set to MediaDrm.KEY_TYPE_STREAMING or MediaDrm.KEY_TYPE_OFFLINE, set initData to the value of psshbox. The value of psshbox can be obtained from a media index file. (The value is obtained from the MPD file for Dash streams and from M3U8 file for HLS streams.)

b) If keyType is set to MediaDrm.KEY_TYPE_RELEASE, the initData parameter can be left empty.

mimeType: media type, for example, video/mp4 or video/webm. For the license deletion, this parameter can be left empty.

keyType:

a) To obtain an offline license, set this parameter to MediaDrm.KEY_TYPE_STREAMING.

b) To obtain an offline license, set this parameter to MediaDrm.KEY_TYPE_OFFLINE.

c) To delete a license, set this parameter to MediaDrm.KEY_TYPE_RELEASE.

optionalParameters: Leave this parameter empty.

  • Send a license request online to the server in POST mode. Set Content-Type in the request header to application/json and the request body to the data obtained by using the getData method of KeyRequest in the preceding step.
  • After receiving a response from the server, use the provideKeyResponse() method to transfer the content of the WisePlay DRM Server response transparently transmitted by the server to the underlying plug-in. The input parameter is the byte array of the license data obtained from the server.

2) Obtain Offline License

  • The process is the same as that in obtain online license. The difference lies in the input parameter for calling the getKeyRequest API of MediaDrm. keyType parameter must be set as MediaDrm.KEY_TYPE_OFFLINE
  • After obtaining an offline license, call the provideKeyResponse method to query keySetId indicating the unique ID of the offline license. Keep it secure for subsequent use.

3) Play Content with Offline License

  • Call restoreKeys() of MediaDrm and pass keySetId. The offline license is used for playing offline content later.
  • If the license has expired or keySetId does not exist, calling restoreKeys will fail.
  • If the license has expired, do not initialize the codec.

4) Delete Offline License

  • The process is the same as that in obtain online license. The difference lies in the input parameter for calling the getKeyRequest API of MediaDrm. keyType parameter must be set as MediaDrm.KEY_TYPE_RELEASE and initData parameter can be left empty.

Things to Consider

  • WisePlay DRM now supports Huawei phones with Kirin 990 chipset (EMUI 10.1 or later installed)
  • WisePlay DRM is available for Enterprise Developers now.
  • You can find more: How to join Huawei Developer, register an account, integrate your apps to Huawei App Gallery and so on.

Please refer to below link.

--

--