[Proposal]: Add experimental.enableResolutionChecks loadVideo option #1533
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.
This is a Proposal to optionally move some "resolution checks" that were historically on the application-side on the RxPlayer side.
Some devices aren't able to play video content with a higher resolution than e.g. what their screen size can display: some will fail on error, others will just infinitely freeze etc.
Many of those devices have vendor-specific API that indicates whether a device was e.g. compatible to 4k content, 1080p content etc.
Until now we told the application developers to do the Representation filtering themselves with the help of the
representationFilter
option from theloadVideo
API. This is because of the vast numbers of devices out there, each with their own API, and because we didn't want to take the risk of having false negatives if it turned out some of those API were not always right.However, many of those devices are very popular (Lg and Samsung TVs, game consoles). Thus I'm wondering if it would be better that we provide some of those resolution checks ourselves, to lower the efforts an application have to make to rely on the RxPlayer on those common devices.
Implementation
For now I added an experimental
loadVideo
option:experimental.enableResolutionChecks
, that has to be set totrue
to enable the behavior. The long term idea would be that for devices where it seems 100% accurate, we would enable the check by default.It will directly filter out resolutions that are too high, unless all resolutions are too high on the current video track in which case it will disable the check (as a security).
In other cases, it follows the exact same rules than the
isCodecSupported
anddecipherable
properties ofRepresentation
.Note about multithreading environment
For now, to simplify, I assume that those vendor API are available in a WebWorker environment. To check if they aren't (in which case we won't filter out anything, so not dramatic either)