Re: [mediaqueries] Media Source Extensions and device capabilities

On Tue, Nov 18, 2014 at 12:43 PM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> On Tue, Nov 18, 2014 at 12:20 PM, Mark Watson <watsonm@netflix.com> wrote:
> > On Tue, Nov 18, 2014 at 9:45 AM, Tab Atkins Jr. <jackalmage@gmail.com>
> > wrote:
> >> This might be something we need to solve in HTML, by adopting
> >> something analogous to srcset.  Or, if we're okay with letting CSS
> >> override <video> source selection, we can solve it with something
> >> parallel to image-set(), specialized for videos.
> >
> > I think it's clear that for the <source> / @srcset case, then giving the
> UA
> > the information is needs to make the choice is the right solution.
> >
> > For our use-case, though, we are using the Media Source Extension so it
> is
> > fundamentally the script that decides which stream is downloaded. So the
> > script needs the same information the UA would use in a declarative
> setting.
>
> 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
(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)

...Mark​


>
> Discounting any connection speed-based decision-making browsers might
> do, this is the same information that the browser uses to decide
> srcset stuff.
>
> ~TJ
>

Received on Tuesday, 18 November 2014 20:55:14 UTC