feat: maxDevicePixelRatio
limits the browser's value
#6825
Merged
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 PR will limit the browser's
devicePixelRatio
for calculations related to player size.Why is this Pull Request needed?
We have more and more devices with high
devicePixelRatio
values. For example, a new iPhone today has adevicePixelRatio
of 3. If a high-density browser (usually mobile phones) requests the video, a level with high resolution is requested. In the past, to avoid this,ignoreDevicePixelRatio
was implemented. However, this results in videos that are sometimes visually detectably low-res. This option provides a granular value to adjust this.For example, if a video on an iPhone loaded before with
{ capLevelToPlayerSize: true }
10 MB, it would now take about 4.5 MB with{ capLevelToPlayerSize: true, maxDevicePixelRatio: 2 }
(10 MB ÷ (3 × 3) * (2 × 2)) with almost no visual degradation (assuming, of course, the levels are available).Are there any points in the code the reviewer needs to double check?
no
Resolves issues:
use case with hight density devices.
Checklist