hls.js
hls.js copied to clipboard
State of hls.js DRM Support
What do you want to do with Hls.js?
Hello, we are using hls.js for quite some time for our live streaming. Now, there are some new requirements that mean that we have to support DRM, at least Widevine and Fairplay. The ideal solution would be to be able to continue hls.js solely without having to add MPEG DASH support as well. So we would use Fairplay with Safari, and Widevine for Chrome & Firefox. PlayReady support would be nice in addition - but not a must have right now.
Now, hsl.js seems to have support for EME & Widevine, however this seems to be still in beta / experimental stage.
Questions:
- Can we already use hls.js with EME / Widevine in production, or is it still too unstable?
- If "no", is there an estimated ETA for Widevine support, ready for use in production?
- How do we handle Safari (macOS / iOS)? Is it possible to use it with Widevide / hls.js or do we need to have another implementation for this?
- Are there any guides and / or code examples how to use EME with hls.js?
Bear with me if some of the questions may be stupid, but this is completely new territory for us.
Any help is greatly appreciated!
Can we already use hls.js with EME / Widevine in production, or is it still too unstable? If "no", is there an estimated ETA for Widevine support, ready for use in production?
The demo includes a working Widevine example: https://hls-js.netlify.app/demo/?src=https%3A%2F%2Fstorage.googleapis.com%2Fshaka-demo-assets%2Fangel-one-widevine-hls%2Fhls.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
Whether that is production-ready or not is for you to determine. All DRM support is community-driven. Open issues and suggestions are being tracked here https://github.com/video-dev/hls.js/projects/6#card-43536969
How do we handle Safari (macOS / iOS)? Is it possible to use it with Widevide / hls.js or do we need to have another implementation for this?
Safari supports Fairplay, not Widevine. hls.js does not include Fairplay support. I suggest that you not use hls.js in Safari and instead use the native HTMLVideoElement support for HLS streams. Apple provides a Fairplay EME example with their server SDK found at https://developer.apple.com/streaming/fps/
The DRM issues and PRs discuss or attempt to add additional key system support, but none address multi-drm well, or include the tests needed to validate and maintain these solutions. #2833 outlines some of the problems with supporting manifest delivered (and multi-drm config) keys. The Sample-AES implementation also has some gaps which limits the types of streams with DRM hls.js can support.
Are there any guides and / or code examples how to use EME with hls.js?
The config options are documents here https://github.com/video-dev/hls.js/blob/master/docs/API.md#emeenabled
emeEnabled
widevineLicenseUrl
licenseXhrSetup
licenseResponseCallback
drmSystemOptions
requestMediaKeySystemAccessFunc
and the demo link above is a working example.
Hey Rob, many many thanks for your answer! So it seems up to us if we want to take the risk of using the beta plugin.
On the other side, if I understand you correctly, the following strategy could work: (and would be tempting, as it would free us from having to support MPEG DASH as well)
- Use hls.js with EME for Chrome/FF/Widevine
- For iOS / Safari, use the native HLS/Fairplay implementation, as you saif hls.js shouldn't be needed anyways.
- Older IE and Edge: ignore for now (are there plans for hls.js to also support PlayReady?)
But you also said that not all DRM streams are supported correctly by the sample AES implementation. Any infos what exactly might be the problem here? We have to support a certain content provider so it would be helpful to check out if this is compatible.
Again, thanks for your valuable insights!
Improved DRM support has been added with #4930 for v1.3.0 and is now in beta. Details in release-notes:
- https://github.com/video-dev/hls.js/releases/tag/v1.3.0-beta.1
- https://github.com/video-dev/hls.js/releases/tag/v1.3.0-beta.2
DRM Project Status: https://github.com/orgs/video-dev/projects/6/views/1
API Documentation is covered under these options:
Multi-DRM support is available as of v1.3.0 https://github.com/video-dev/hls.js/releases/tag/v1.3.0
For additional DRM features and bugs see issues labeled https://github.com/video-dev/hls.js/labels/DRM and track their status via the DRM project https://github.com/orgs/video-dev/projects/6