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

[cssom-view] Expose video plane pixel ratio #6891

Open
chcunningham opened this issue Dec 15, 2021 · 3 comments
Open

[cssom-view] Expose video plane pixel ratio #6891

chcunningham opened this issue Dec 15, 2021 · 3 comments

Comments

@chcunningham
Copy link

Discussion started in #5044. The main idea is to expose the device pixel ratio for <video>, allowing authors to select an optimal content resolution. UAs on TV's and dongles will often have a distinct video "plane" with a higher device pixel ratio than reported by window.devicePixelRatio.

I propose adding deviceVideoPixelRatio to Screen. Authors can then determine the "video" pixels of anything, including screen (width, height), window (availWidth, availHeigh), as well as inline. For example:

full screen case

targetResolution = screen.width * window.deviceVideoPixelRatio;

inline case

targetResolution = element.clientWidth * window.deviceVideoPixelRatio;
@chcunningham
Copy link
Author

chcunningham commented Dec 15, 2021

This proposal was discussed in today's call. Full transcript here. Let me respond to some points:

smfr: imagine you have two screens, right hand is dedicated to video presentation
smfr: somehow magically when you present video, it shows up on the right
smfr: but window object is associated with the left hand screen
smfr: so would be weird if it reported characteristics of right hand screen
???: Is this possible today?
smfr: UA thing, UA could decide to send fullscreen video to a particular screen
...
florian: a browser could have two different videos on different screens, but that's a very different setup than here
smfr: I understand, I just don't want us to design a problem for foldables

I think this idea to relocate fullscreen video is problematic because most streaming sites actually fullscreen a div containing the video to allow for custom controls.

florian: This isn't necessarily about fullscreen video.
florian: if you have youtube playing in the middle of your web page, you would apply this ratio within the video
smfr: No, I don't think so, I think it only applies to fullscreen
...
smfr: I think we should ask experts for feedback

@jpiesing (TV expert) indicated that this is not just about full screen in #5044 (comment).

smfr: I think it would be very confusing for author

@smfr, can you say more about the confusion? Streaming sites are already be accustomed to listening for changes to the element size and/or fullscreen events as a trigger to adapt content resolution.

@smfr
Copy link
Contributor

smfr commented Dec 16, 2021

Do devices with a separate video plane use that for inline video?

@chrisn
Copy link
Member

chrisn commented Dec 16, 2021

TV devices do that, yes. The hardware then arranges for the video plane to be composited (with appropriate scaling) with the graphics plane when to produce the output for the display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants