DRM: Only check cached MediaKeySystemAccess compatibility with most w… #1591
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…anted key system
When loading a content with the RxPlayer, you can provide multiple DRM configurations (e.g. Widevine L1, PlayReady SL3000, Widevine L3 etc.) in a certain order of preference.
The idea is that the RxPlayer will attempt one after another and finish with the first compatible one.
To speed up later video loading operations, the RxPlayer always re-check at each video load operations if the last created MediaKeySystemAccess is compatible with one of the configuration, and if it is, use that one.
However turns out that this is not always what application wants. We've seen for example a device with both Widevine and Playready where the application wanted Widevine in priority for some contents and PlayReady in priority for other contents, yet always asking for both (just in a different order of preferences for those various contents).
Due to our MediaKeySystemAccess-reusage strategy, even if PlayReady is prioritized for a latter content and the device is compatible with it, we could be still using Widevine because it was already the DRM system used for the last content and because Widevine was still OK for the application, just less prioritized.
Instead of this, this modification only reuse the "cached"
MediaKeySystemAccess
if it corresponds to the current most wanted configuration (i.e. it is re-checked with each iterations on thekeySystems
option before the actualnavigator.requestMediaKeySystemAccess
call).