Google Cast Receiver App screen resolution

1.3k views Asked by At

I'm developing an app for Google Cast, and I'm testing at my Android TV with google cast.

I put a debbuging info to show screen resolution. My TV is 4K, but when displaying data from document.body.clientWidth and document.body.clientHeight I get 962x541. I was expecting at least Full HD 1920x1080.

Is there something I'm missing to set at receiver app?

2

There are 2 answers

1
Leon Nicholls On

For Android TV it should be similar, but on Chromecast Ultra, the receiver has 1080p physical resolution and 720p css resolution. The ratio between css and physical pixels is called "device pixel ratio" and can be accessed using CSS queries using dppx units (https://developer.mozilla.org/en-US/docs/Web/CSS/resolution), or img srcset attribute using pixel density descriptor (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img), or window.devicePixelRatio from JavaScript (https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio).

0
edgarian On

Custom receiver apps are locked to 720p for performance reasons - running a Chromium-based browser is hard work. Google has said for years that 1080p is potentially on the way but it's never arrived.