W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [mediaqueries4] Media queries for multichannel audio ?

From: Robert O'Callahan <robert@ocallahan.org>
Date: Thu, 21 Mar 2013 18:21:30 +1300
Message-ID: <CAOp6jLafeocdsQw9_LwyXo9TyHAaFERCnXKKj4Nw-35Qk4bXEQ@mail.gmail.com>
To: Mark Watson <watsonm@netflix.com>
Cc: Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>, "florian@rivoal.net" <florian@rivoal.net>, "www-style@w3.org" <www-style@w3.org>
On Thu, Mar 21, 2013 at 4:37 AM, Mark Watson <watsonm@netflix.com> wrote:

> On Mar 20, 2013, at 8:09 AM, Kenneth Rohde Christiansen wrote:
>
> > WebKit has devicePixelRatio so you can device the device size by using
> > that.
>
> This tells me the ratio between CSS pixels and device pixels, but this is
> still meaningless for TVs, since there is no definition of CSS pixels for
> TVs (a bit of a problem generally for web browsers on TVs, but
> nevertheless…).
>
> What I need is just the device width and height in device pixels, to know
> when it is not worth delivering a high resolution version of the content.
> It's not such a big deal with HD, since there are a dwindling number of SD
> displays, but with 4K this will be an issue.
>

You can get the viewport size (window.innerWidth/innerHeight) in CSS pixels
and multiply by devicePixelRatio to get the size in device pixels.

Rob
-- 
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]
Received on Thursday, 21 March 2013 05:21:58 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT