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
capLevelToPlayerSize and devicePixelRatio #3647
Comments
…lRatio in calculation for stream level choice calculations
I forked and added a setting like I'm suggesting. If you like this approach, I am happy to go through a PR for this. Thoughts? |
Using You can always set |
I realize it's intentional, but forcing it into pulling streams that are exponentially more expensive to stream (both client performance and bandwidth wise) than respecting the static dimensions set by the page author seems heavy handed... I won't argue the need, of course, but I'd like to request the OPTION to ignore I actually wouldn't mind expanding my change to a more general setting to allow ignoring |
Something like this? master...i8beef:master This also gives you a nice disconnect point from a direct |
Just a note, this would make more sense as Then the devicePixelRatio function can also be simpler:
Also when seeing this (in contentScaleFactor), is the try/catch necessary? Wouldn't |
I am open to any requested changes to get this in, I'm flexible! I just went I kept the try catch as it was used in the other implementation... I assumed it had something to do with being used in a non-browser / test scenario where |
Respecting DPI is the desired default as that is in-line with how other media elements should be used (img with srcset and picture with source for example). The quality difference is quite noticeable. As an example CSS in Safari on an iPhone 11 will tell you that it's 414x896 pixels when the display really is 828x1792 (and it will render everything at 2x and upscale images and videos 2x if they don't have pixels to fill the display). |
I think that's an excellent point... I'd point out though getting around this exact situation is why the |
I've looked through your contribution guidelines and made all changes I think are necessary to my fork. Should I make a PR, or is there a process to moving from "feature proposal" to a PR? |
What do you want to do with Hls.js?
I would like to use
capLevelToPlayerSize
, but with out thedevicePixelRatio
adjustment introduced here:hls.js/src/controller/cap-level-controller.ts
Line 225 in 2896a73
I was looking at using this setting to pick lower resolution streams between small in-line players and full screen mode... unfortunately, because so many devices use a
devicePixelRatio
with higher resolution displays now, its stuck always picking the highest stream because it's taking the video element's dimensions, and then multiplying it by 2 or more.Essentially, I'd like this mode to respect the specified dimensions of the video element to choose streams and not try and adjust.
What have you tried so far?
Various forms of live patching the objects themselves, but I haven't found a combination that lets me override
contentScaleFactor
to always return 1. Up for any suggestions, but I'm unsure how I could do this without an added config option to effect this directly...The text was updated successfully, but these errors were encountered: