Shaka Player
lastmod 2023-07-11created 2023-04-217 edits
A JavaScript library for adaptive video streaming.
Multi-DRM service integration
The growth of video content distribution through the spread of the internet has caused demand for VOD streaming content to explode worldwide. VOD has let many customers watch video content conveniently, but it has also become a target of hackers' unauthorized content copying attacks. This means content creators and distributors must pay more attention when distributing premium content and applying end-to-end security.
Digital rights management (DRM) technology secures the distribution of content so that copyrighted works are protected, and prevents access by anyone other than designated users. Forensic watermarking technology also reveals the source from which a video leaked. Thus, forensic watermarking and multi-DRM technology are the two core technologies for strong content security.
Most OTT content is consumed in applications. However, many OTT service consumers still prefer to watch content in a web browser. A video monetization platform company has stated that 35% of its OTT service users watch video in a web browser environment, while the rest watch through applications on smartphones, smart TVs, and the like. Because consumers consume content on various platforms like this, you must be able to provide content on multiple platforms, not just one, to maximize subscribers.
DRM technology providers are fragmented by the operating systems and web browsers they support, and to simplify this for convenient use, the major DRM systems apply a standardized video protection technology called CENC (Common encryption). This means that a single video content format, encrypted only once, can be played on multiple platforms. For example, content encrypted to be playable in the Microsoft Edge browser, which uses the PlayReady CDM, can also be played on Android, which uses Google Widevine. Because of this, CENC reduces the cost of encrypting and managing content, and since native DRM clients can be used for free on their platforms, license costs can also be reduced.
To stream DRM-protected content, producers use an adaptive player that can integrate with content security solutions, such as Shaka Player. Shaka Player is an open-source Java library that can play media formats such as Dash and HLS without additional plugins or Flash. Shaka Player uses Encrypted Media Extension(EME) and the open web standard Media Source Extension(MSE) for DRM playback, and uses IndexedDB for offline storage and media playback.
Content can be stored in any browser, whereas whether licenses can be stored depends on browser support. Because Shaka Player is a standardized format, once encryption is done, it can be played in any browser that uses industry-adopted media containers such as ISO BMDD 9i.e.MP4 and WebM. It is also easy to adopt because it supports various content protection platforms.
The EME used by Shaka Player requires a secure URL such as https or localhost. Because multiple content formats may be used, if the site uses https, all manifests and segments must also use https.
How to integrate Shaka Player with a multi-DRM service
- Basic video player setup
- In the first step, you can use the Shaka Player library to add a video without DRM protection.
- Adding the DRM configuration
- To play DRM-protected content, you must set the DRM configuration on the player instance created in the previous step.
- License server
- The application's license server must apply some authentication steps so that licenses are delivered only to authorized users. To play protected content, Shaka Player needs a license server endpoint and a manifest file. You must configure the player to use the provided license server before loading the manifest.
- There are various authentication methods, such as header authentication, parameter authentication, and cookie authentication. PallyCon uses header authentication, in which the endpoint requires a specific header value to provide a license. Arbitrary headers can be requested through Shaka Player's request filter callback. The application can fetch the authentication header value before or during the callback, or use a fixed value.
- Key system
- Shaka Player uses EME to check which key systems the browser supports. This means it is key-system agnostic; if the browser supports multiple key systems, the first key system supported in the manifest is used. CENC is an interoperable encryption standard used by most DRM providers because it works with all content formats. In addition, some DASH manifests state that a CENC system can be used.
- 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 through encrypted keys in the Clear key system. Clear key is also used to identify problems and test integrations. You can also configure it by providing key IDs to content keys in hexadecimal format using the DRM.clearKeys field.
- Shaka Player also has UI controls for controlling video. To apply the UI, you can use the Shaka-Player.ui.js build, and you can add the data-shaka-player-container component to the video's parent div attribute. This lets you add UI controls to that div. Shaka Player also supports subtitles. If the DASH or HLS stream already has subtitles, they can be used right away; otherwise, you can use source code to add a subtitle file.
- Thus, Shaka Player is easy to integrate with multi-DRM services and can play MPEG-DASH and HLS streams on all platforms. Multi-DRM service providers offer processes that integrate easily with the player and help content creators strengthen the security of their premium content. Working with a third-party content security partner can reduce the cost of protecting OTT content, and it is fast, efficient, and hassle-free.
Projects
- Shaka Player React
- A simple React component wrapper for shaka-player
- https://github.com/matvp91/shaka-player-react
See also
- DRM
- Widevine
- MPEG Common Encryption (CENC)
- Shaka Streamer - A simple, config-file-based approach to preparing streaming media, based on FFmpeg and Shaka Packager.
- Shaka Packager - A media packaging SDK for C++ programmers writing DASH and HLS packager applications with common encryption support, live, and VOD.
- Shaka Player - A JavaScript library for adaptive video streaming.