How to integrate Shaka Player with a multi-DRM service?

PallyCon > Content Security  > Multi-DRM  > How to integrate Shaka Player with a multi-DRM service?

How to integrate Shaka Player with a multi-DRM service?

The increase in internet penetration and ease of video distribution have made streaming VoD content extremely popular across the world. This has also meant that creative studios and content distributors now have to be extra cautious while developing an end-to-end security strategy for premium content. Digital rights management (DRM) technology enables secure transmission of video content such that its copyright is protected and it cannot easily be accessed by anyone other than the intended user. Multi-DRM technology, combined with forensic video watermarking, which helps in identifying the source of video leakage, are, thus, the two key aspects of any robust content security solution.

While OTT content is mostly app based, a large section of viewers still prefer watching it in web browsers. A video monetization platform concluded that almost 35% of viewing happens on web browsers while the remaining use native OTT apps on mobile devices and smart TVs. Hence, it is important for content providers to be able to reach all platforms in order to access the maximum subscribers.

The DRM technology providers landscape is fragmented in terms of the various operating systems and web browsers that they support. To help simplify this fragmentation, a standardized video protection method called Common Encryption (CENC) has been adopted by the leading DRM systems. CENC comprises a common format for encryption, decryption, and key mapping methods. This allows a single content file-set to be distributed across various platforms with a single encryption. In essence, the same encrypted video can be played by Microsoft’s Edge browser (via PlayReady CDM) as well as Android devices by using Google Widevine. CENC substantially reduces the cost of encryption as well as the cost of managing encrypted assets. In addition, it also helps eliminate the DRM client licensing cost since the native DRM client is usually free on the platform.

In order to stream content along with DRM technology, studios rely on adaptive media players, such as Shaka Player, which can be integrated with the content protection solution. As an open source JavaScript library, Shaka Player can play adaptive media formats, such as DASH and HLS, in a browser without the use of any additional plugins or Flash. It uses Encrypted Media Extensions (EMEs) and the open web standards MediaSource Extensions for DRM playback. In addition, it uses IndexedDB to support offline storage and media playback.

While content can be stored in any browser, the storage of licenses depends on browser support. Shaka Player has a standardized format, meaning once encrypted, content can be played anywhere utilizing industry adopted media containers including ISO BMFF 9i.e.MP4 and WebM. It also covers multiple content protection platforms, making it easy to implement. EMEs used by Shaka Player require a secure URL, such as https or a localhost. Since multiple content formats might be used, if the site uses https, all other manifests and segments would also need to use https.

Steps to integrate Shaka player with a multi-DRM service:

  1. Setting up the basic video player:

    In the first step, the video without DRM protection can be added using the Shaka Player library.

  2. Adding DRM configuration:

    To play DRM-protected content, the DRM configuration must be added to the player instance created in the previous step.

  3. License servers:

    The application’s license server would need some authentication so that the licenses are delivered only to the authorized users. For playing the protected content, Shaka Player requires the license server endpoints and manifest file it needs to use. The player needs to be configured to use the provided license server before it loads the manifest. There are different authentication methods like Header Authentication, Parameter Authentication, Cookie Authentication, etc. Pallycon uses Header Authentication method where the endpoint requires a specific header value in order to deliver the license. Any arbitrary header can be added to Shaka’s requests through a request filter callback. The application can get the authentication header values before or during the callback or use any fixed value.

  4. Key system:

    Shaka Player uses EME to identify the key system supported by the browser, i.e., it is key-system agnostic. In case multiple key systems are supported by the browser, the first key system supported in the manifest is used. Since CENC can work on all content formats, it is the interoperable encryption standard implemented by most DRM vendors. Moreover, some DASH manifests only specify that any CENC system can be used.

  5. Clear key:

    Because of the EME specification used by Shaka Player, browsers must support a common key system called “Clear Key”. CENC content is decrypted using unencrypted keys in the Clear Key system. They can also be used to identify problems and test integrations. Clear Key can be configured by using the drm.clearKeys field and giving a map of the key IDs to content keys (in hex format).

  6. Clear key license:

    If only the Clear Key system has been specified by the manifest, the normal license request technique can be used to retrieve keys based on the key IDs. A JSON-based license request format and a license format for the Clear Key CDM (Content Decryption Module) is usually defined by the EME specification.

Shaka player has the UI controls for the video element as well. In order to implement the UI, the shaka-player.ui.js build can be used and the data-shaka-player-container attribute of the parent div of the video can then be added. This will consequently add the UI controls in that div. Shaka Player also supports subtitles. If the DASH or HLS stream already has the subtitles embedded inside, they can be used directly. If not, a source code can be used to add the separate subtitle files.

Thus, Shaka Player can easily be integrated with a multi-DRM service to play MPEG-DASH and HLS streams across all platforms. Multi-DRM service providers can implement these processes effortlessly and allow content producers to enhance the security of premium content. With such third-party content protection partners, securing OTT content can be a cost-saving, fast, efficient and hassle-free exercise.

Pallycon provides DRM integration sample code for various HTML5 players including Shaka Player. Demo content and integration data are included in the sample code which can be used to test playback of DRM content.

PallyCon