W3C home > Mailing lists > Public > www-style@w3.org > November 2014

Re: [mediaqueries] Media Source Extensions and device capabilities

From: Mark Watson <watsonm@netflix.com>
Date: Tue, 18 Nov 2014 15:53:29 -0800
Message-ID: <CAEnTvdCzSNuiR0hSV_P_sEPg-w28ci0K=OsCLY32N2W6iTmibQ@mail.gmail.com>
To: Florian Rivoal <florian@rivoal.net>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
On Tue, Nov 18, 2014 at 1:50 PM, Florian Rivoal <florian@rivoal.net> wrote:

> > On 18 Nov 2014, at 22:11, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> >
> > On Tue, Nov 18, 2014 at 12:54 PM, Mark Watson <watsonm@netflix.com>
> wrote:
> >> On Tue, Nov 18, 2014 at 12:43 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> >> wrote:
> >>> Ah, if scripting is involved, this is easier.  window.devicePixelRatio
> >>> gives you the screen density on all webkit/blink/ff browsers (dunno
> >>> about IE).  You can then just measure the element normally using
> >>> existing JS APIs, and use those two pieces of information to figure
> >>> out what source to load.
> >>
> >> There are two issues with that approach:
> >>
> >> (1) I'm buffering ahead of time, so really I am interested in what the
> >> situation would be if the video went fullscreen
> >
> > Ah, you're worried about the case where the browser itself isn't
> > full-screen, so the fullscreen video dimensions might be larger than
> > the browser window?
> Can’t you use window.screen.height / window.screen.width in this case?

​Yes, combined with devicePixelRatio, this looks like it would be good for

> >> (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

Can you explain in more detail how it they could "dynamically reflect this
kind of thing into the resolution media query" ?

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.

If this is not something which admits a generic solution with existing CSS
tools (or sensible extensions thereof), that would be good feedback for the
html-media group. Since it seems analogous to a basic device capability (HD
vs UHD screens) it seemed there should be a generic solution, but if not,
then we could define a point solution for this in html-media.


> <semi_serious>
> Is this another use case for RFC6919’s MAY WISH TO?
> “If the rendering produced by the User Agent
> is known to be later downscaled by the display system
> (for example, due to HDCP),
> the User Agent may wish to reflect this downscaling
> in the value of the resolution media feature”
> </semi_serious>
>  - Florian
Received on Tuesday, 18 November 2014 23:53:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:48 UTC