Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display web sites and web apps with Chromecast

Can Chromecast be used to display a web site or web app? All the sample sender/receivers I've seen so far show how to play videos. The docs posted so far are minimal as best, just an API reference with little explanation what any of it does. I just want to send a URL of my choosing and have that page displayed on the TV. There's no user interaction required past that point. Assuming that's possible, does anyone have sample Chrome sender and receiver code for that?

like image 542
kbriggs Avatar asked Feb 21 '14 21:02

kbriggs


People also ask

Can you look up websites on Chromecast?

No, Chromecast with Google TV doesn't have a web browser. However, you can cast a Chrome browser on your computer to the TV using the regular cast tab option or you can use your smart phone and mirror the Chrome browser to your TV.

How do I display apps on Chromecast?

Under the My Apps section highlight the app you want to move and press and hold the Select button on the remote for a second. The next screen will give you some options, select the Move button. Now you can move the app to the location you want it to appear using the D-pad on the remote.

Can you use other apps while Chromecasting?

Chromecast's multitasking capabilities allow you to continue using your laptop, tablet, or mobile device while casting videos or casting a Chrome browser tab. Once you begin casting, your device is available to open other apps, check emails and social media, create YouTube playlists, and even text.


1 Answers

I was able to modify the Github sample Project > googlecast/CastHelloText-chrome to show a web page.

  • In the receiver.html file, I replaced the DIV with an IFRAME and styled it for 100% width and height.
  • Then in the displayText() function I changed innerHTML to src.
  • The only modification made to the sender chromehellotext.html was to replace YOUR_APPLICATION_ID with the app id created by registering the receiver.

Note that some sites like Google and Yahoo will not display inside an iframe. If you really needed to do that you could skip the iframe and just set window.location.href to the URL. That, of course, will overwrite your receiver code so the only way to change URLs would be to manually disconnect first and reload. I tried using window.open instead but that did not work.

like image 55
kbriggs Avatar answered Sep 30 '22 20:09

kbriggs