Re: [mediaqueries] Media Source Extensions and device capabilities

> >> (2) There are scenarios where video gets downscaled, most notably when
> >> output over HDMI (due to HDCP, yes, I know), and in these scenarios I am
> >> interested in the actual output resolution (after downscaling)
> >
> > Hm, that's much weirder.  I don't know how easy/possible it is to
> > acquire that information in browser-land.  I assume it probably is,
> > but shrug.
> 
> I would tend to say it is the User Agent’s job to dynamically reflect this kind of thing into the resolution media query, but I don’t have a particularly high faith that browser vendors will bother.
> 
> ​There are certainly browser vendors who are implementing this kind of downscaling and I believe have an interest in exposing it in a standard fashion.
> 
> Can you explain in more detail how it they could "dynamically reflect this kind of thing into the resolution media query” ?

resolution, like other media queries, is supposed to reflect the environment, and to change if the environment changes. So if you started with a high resolution, and all of a sudden you’re on a low one (due to downscaling or whatever), resolution should be updated.

> I think the problem is that the resolution restriction is specific to the video element output: what I need to know is the resolution (in the X x Y pixels sense) of the video element output, if it was fullscreen.

Do you mean that HDCP will downscale only one area of the screen, as opposed to the whole screen, or that it will respond to the presence of video by downscaling the whole screen, but wouldn’t do the downscaling if there was no video element?

If the presence of the downscaling can depend on the content you show and how you show it, media queries is the wrong tool for the job.

@media (fullscreen-video-res < 2dppx) { video { display: none } } /*now the screen flickers, as running the video drops the resolution, which stops the video, which increases the resolution, which starts the video… */

On top of that, given that what you want is to directly ask for x and y, rather than have your content be adjusted for you if you cross certain thresholds, it really seems to me that a JS API would be a more straightforward solution to your problem.

While I don’t think it would be impossible to solve your use case with new media queries, the constrains we need to deal with to make sure that these queries make sense for more than your specific use case will bring quite a bit of baguage that I don’t think will be of much interest to you.

 - Florian

Received on Wednesday, 19 November 2014 08:27:05 UTC