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

feat: maxDevicePixelRatio limits the browser's value #6825

Merged

Conversation

signalwerk
Copy link
Contributor

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 a devicePixelRatio 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

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.6.0 milestone Nov 2, 2024
@robwalch robwalch merged commit f53373f into video-dev:master Nov 14, 2024
12 checks passed
@signalwerk signalwerk deleted the feature/max-device-pixel-ratio branch November 15, 2024 13:56
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.

2 participants