Skip to content

Conversation

@peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Dec 23, 2024

Thanks to the PR #1478, that basically allows integration tests on our DRM logic without a real encrypted or decodable contents nor MSE/EME available, I noticed that I very recently brought a minor regression in the rewrite of the MediaKeySystemAccess cache reusage rules (not yet released).

We relied on the keySystems[].type API to see if the cached one was compatible to the new wanted one, we probably wanted to compare the former with the type actually provided as argument to the navigator.requestMediaKeySystemAccess API instead (e.g. keySystems[].type could be set just to widevine, in which case the RxPlayer will probably ask for com.widevine.alpha instead).

Thankfully, EME defines a MediaKeySystemAccess.prototype.keySystem property that seems to always be equal to the asked keySystem.

Thanks to the PR #1478, that basically allows integration tests on our
DRM logic without a real encrypted or decodable contents nor MSE/EME
available, I noticed that I very recently brought a minor regression in
the rewrite of the `MediaKeySystemAccess` cache reusage rules.

We relied on the `keySystems[].type` API to see if the cached one was
compatible to the new wanted one, we probably wanted to compare the
former with the `type` actually provided as argument to the
`navigator.requestMediaKeySystemAccess` API instead (e.g.
`keySystems[].type` could be set just to `widevine`, in which case the
RxPlayer will probably ask for `com.widevine.alpha` instead).

Thankfully, EME defines a
[`MediaKeySystemAccess.prototype.keySystem`](https://www.w3.org/TR/encrypted-media-2/#dom-navigator-requestmediakeysystemaccess)
property that seems to (according to that recommendation) always be equal
to the asked `keySystem`.
@peaBerberian peaBerberian force-pushed the fix/same-key-system-type-cache branch from 192bf78 to 8aec1c3 Compare December 23, 2024 13:55
@peaBerberian peaBerberian added this to the 4.3.0 milestone Dec 23, 2024
@peaBerberian peaBerberian added the Priority: 1 (High) This issue or PR has a high priority. label Dec 26, 2024
@peaBerberian peaBerberian merged commit a117437 into dev Jan 7, 2025
11 checks passed
@peaBerberian peaBerberian mentioned this pull request Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 1 (High) This issue or PR has a high priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants