-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MSE support for FairPlay #3346
Comments
Necessary changes:
|
I think Shaka should also provide a way for developers to be notified of which keySystem has been selected for playback, so that we could fetch/cache the appropriate certificate, and give it back as configuration (could have the same logic that the request/response filters). |
I have seen Disney + uses HLS manifest with PlayReady, Widevine, and Fairplay using MSE. That would make us have greater efficiency in the CDN, since there would only be one copy (it would not be necessary to maintain DASH and HLS according to the device). @joeyparrish What is your opinion about this? What priority is this for the ShakaPlayer? |
Do you mean in a specific event? Or just that you should be able to get it in general? Today you can get this info with Would this suffice, or would you prefer a bespoke event?
This is really exciting! I remember spending lots of fruitless hours trying to make MSE+FairPlay work, so it would be amazing to be able to enable it on desktop and MSE-enabled iOS devices. I will defer to @ismena for priority, as she has taken over as the team lead. |
I have been doing some testing and I have seen that MediaCapabitilies in Safari does not seem to support the encryption part, so with what is now in the repo it would not work. I think it is related to shaka-project/eme-encryption-scheme-polyfill#18, @michellezhuogg , can you confirm it? |
@joeyparrish I think we should have a That's a thing we already do with the Widevine certificate even if it is not the same exact use case, since we have two license requests triggered by the CDM (the first one to fetch the certificate, the second to fetch the license). |
@valotvince Maybe #1906 ? |
@avelad Totally ! |
PRs on this are very welcome if anybody's interested, otherwise we'll consider it for the team to work on in Q3/Q4. |
Important thing I have seen:
|
@joeyparrish , you reported #2337, you say that SourceBuffer into sequence mode can be a solution to support formats without container, you know if this could fix the problem that TS is broken for safari? (using sequence mode for TS) https://github.com/google/shaka-player/blob/master/lib/polyfill/mediasource.js#L42 |
Based on the comments, it seems that the issue with TS in Safari is what happens when you call "abort()" on a SourceBuffer. I'm not sure I see how sequence mode would change the need to call abort() in some cases. The Safari bug is still reproducible in Safari 14, and nobody from Apple responded in the 4.5 years that bug has been known. Perhaps to enable direct TS in Safari (without waiting for Apple to fix bugs in WebKit), we could investigate more deeply what it would take to eliminate calls to abort(). I haven't touched that part of the code in a long time, so I don't recall the details. |
So now we Can play drm content in iOS browser? A bit confusing for me Is HLS+iOS safari + FairPlay. As shaka docs Matrix say "native" i think no, but on bitmovin/prestoplay ive Seen support in Matrix. Is It just their player? |
We can already play DRM content in iOS browsers, but only through "native" HLS, using What we're discussing here is how to support our own HLS implementation through MediaSource, while still using FairPlay. FairPlay is only available in Safari, and MediaSource is not generally available on iOS, except some versions on iPad. So this would apply only to iPads and macOS. Hopefully Apple will offer MediaSource on all iOS devices some day.
"Native" there refers to "native HLS", or Apple's built-in HLS implementation in Safari. Shaka can use that to get FairPlay support. There is work to be done (and documentation to be written by Apple) to allow us to fully support FairPlay with MediaSource playbacks. We would prefer to use MediaSource everywhere we can. |
Add support for HLS com.apple.streamingkeydelivery through MSE/EME implementation. Close #3346 ## Tests Tested on: - Mac 11.6 Safari 15.2 - iOS 15.2 Safari 15.2 - Mac 11.6 Chrome 96 (for potential regressions on Widevine keySystem) | Mode | DRM API | TS | CMAF (mono-key and multi-keys) |---|---|---|---| | file | EME | ✅ | ✅ | | file | Legacy-prefixed | ✅ | ✅ | | media-source | EME | **mux-js**: `encrypted` never fired<br />**real MSE**: `encrypted` event received, but with incorrect `sinf` initData (*1) | ✅ | | media-source | Legacy-prefixed | **mux-js**: `webkitneedkey` never fired<br/>**real MSE**: TBD | 🔴 fails to append media segment to SourceBuffer (init segment ok) `(video:4) – "failed fetch and append: code=3015"` | ## Support table | Mode | DRM API | TS | CMAF (mono-key and multi-keys) |---|---|---|---| | file | EME | ✅ | ✅ | | file | Legacy-prefixed | ✅ | ✅ | | media-source | EME | 🚫 `4040: HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED` | ✅ | | media-source | Legacy-prefixed | 🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED` |🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED` |⚠️ Use EME APIs with multi-keys CMAF makes the video stalling with the audio continuing alone after a short time (~3 minutes in the stream, could be shorter, could be longer). Didn't find an explanation to that yet. I've observed the same behaviour with hls.js code so I don't think this is a player issue.
I just discovered that Apple has updated all the FairPlay integration documentation including MSE example and how to use the api without prefixes (#2999).
Attached the relevant part in case someone does not have access:
FairPlay Streaming in Safari.zip
There are examples with key rotation, multi keys, etc.
The text was updated successfully, but these errors were encountered: