0

As the title of this post, I would like to know if we have a way to use pure Javascript and video HTML5 to play DRM content (movie, tv channel).

I am handling a website which provide DRM contents. For each browser, we have to use a different DRM provider with different configuration. For example Safari support only Fairlay, Chrome support Widevine, Edge support both Widevine and Playready.

Currently we have to use third party such as Shaka player, Dashjs,... to play these. I realize that this is quite complicated. I see that all library is written in Javascript. The main flow will be reading the stream manifest, call the DRM server to get the key, get the encoded segments. Then decode the segments by the key returned from the DRM server.

I wish we have a way to use pure Javascript & video HTML5 only. Is this possible?

Thanks.

vanminhquangtri
  • 145
  • 1
  • 9

1 Answers1

0

Firstly it is worth mentioning that you can encrypt the content with a single key and use different DRM's to share that key with each browser/device - take a look at CENC if you are not familiar with it (https://docs.unified-streaming.com/documentation/drm/common-encryption.html, https://websites.fraunhofer.de/video-dev/is-this-the-end-of-cenc-an-overview-of-drm-codec-support-in-2021/).

Unfortunately, CENC, or common encryption as it often known, still has variants and while in the future we may see only the 'cbcs' variant being used, at the moment many devices still require 'cenc' (small letters this time - one of the CENC protection schemes). So for now you still have to encrypt HLS and DASH streams differently to cover all devices.

Addressing your question around implementing the player yourself using plain Javascript and HTML5, you could write a player yourself using the Media Source Extensions (MSE) HTML5 mechanism, but you will likely end up with something similar to Shaka Player or VideoJS if you make it full featured, and these are open source anyway.

The actual video decryption is separate from these players and is in the CDM (Content Decryption Module) which is associated with the browser. Although the interfaces to a CDM are standardised, the CDM implementation is particular to each DRM and browser. This is definitely not open source and in a device with a secure media path, not even the OS should be able to see the decrypted video chunks or stream.

Mick
  • 24,231
  • 1
  • 54
  • 120