Skip to content
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

Reuse cache even if key system type given in API is not the same #1611

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant