Skip to content

Conversation

@Florent-Bouisset
Copy link
Collaborator

Edge and Firefox browsers tends to crash when reusing the mediaKeySystemAccess object when switching between different contents while using Playready DRMs.
I propose to recreate the mediaKeySystemAccess when switching content on those device to mitigate the issues.
This would have the disadvantage of not having a session cache for temporary licence, but It would improve the stability.

@Florent-Bouisset Florent-Bouisset force-pushed the fix/firefox-and-edge-renew-keysystem-access branch from e6220fc to b6efa70 Compare April 10, 2025 13:41
@peaBerberian peaBerberian added DRM Relative to DRM (EncryptedMediaExtensions) Priority: 0 (Very high) This issue or PR has a very high priority. Efforts should be concentrated on it first. labels Apr 10, 2025
@Florent-Bouisset Florent-Bouisset force-pushed the fix/firefox-and-edge-renew-keysystem-access branch from b6efa70 to 647ed5f Compare April 10, 2025 13:46
@peaBerberian
Copy link
Collaborator

Note to give some more context: it seems that the very new PlayReady support on Firefox is very buggy for now, yet it adds hardware DRM on firefox windows, so we highly do want it because it allows support of higher-quality content with Firefox windows (like only edge windows does for now).

What we noticed is that:

  1. Changing between two different contents (encrypted with different keys) with PlayReady SL3000 led to a GENERATE_KEY_REQUEST_ERROR (an error while asking to generate the challenge) when switching to the second content

  2. Reloading the same content (or different ones encrypted with the same key I guess?) with PlayReady SL3000, with our active MediaKeySession cache (so no need to reload the licence) led to infinite rebuffering

  3. Our usual work-around for those kind of lower-level CDM problems, which is to restart from the MediaKeys-creation step, weirdly didn't have an effect here

  4. However, what is proposing Florent here: re-starting from the first EME API, navigator.requestMediaKeySystemAccess, (which until now was always assumed to mainly be about polling decryption capabilities, so no need to do it X times) did fix those two issues

So we talked about it and decided that for Firefox PlayReady, we can just restart from the beginning and not profit from our MediaKeySession cache - nor on the optimization of not re-calling EME API (which can last hundreds of ms even on performant devices) for already-loaded contents.


In an almost-related issue, we also had a lot of UWP (universal windows platform - which relies on Edge for Web views) and Edge windows issues recently (well, since forever to be perfectly honest).
We decided in the same effort to also disable the cache - from that same step - for Edge PlayReady as we figured the optimizations it allows does not justify all the issues it brings.

@github-actions
Copy link

✅ Automated performance checks have passed on commit 0ce0dcfc5cd7866eda7069f0d21c3d86ad019914 with the base branch dev.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.67ms -> 19.66ms (0.007ms, z: 0.14609) 27.00ms -> 27.00ms
seeking 18.13ms -> 14.07ms (4.061ms, z: 1.54321) 11.40ms -> 11.40ms
audio-track-reload 27.12ms -> 27.00ms (0.124ms, z: 0.55687) 39.30ms -> 39.45ms
cold loading multithread 49.02ms -> 48.11ms (0.913ms, z: 9.82316) 71.70ms -> 70.65ms
seeking multithread 22.74ms -> 26.76ms (-4.021ms, z: 0.40080) 10.50ms -> 10.50ms
audio-track-reload multithread 26.92ms -> 26.89ms (0.031ms, z: 0.14580) 39.45ms -> 39.45ms
hot loading multithread 16.07ms -> 15.91ms (0.157ms, z: 3.17029) 23.10ms -> 22.95ms

@Florent-Bouisset Florent-Bouisset merged commit c19d1df into dev Apr 10, 2025
10 checks passed
@peaBerberian peaBerberian added this to the 4.4.0 milestone Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DRM Relative to DRM (EncryptedMediaExtensions) Priority: 0 (Very high) This issue or PR has a very high priority. Efforts should be concentrated on it first.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants