Display web sites and web apps with Chromecast

31,923

Solution 1

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.

Solution 2

One could imagine writing a Custom Receiver that has an iframe that wraps any website. Your sender would could then send webpages to your receiver, and the onLoad would set the the URL of the iframe. Don't have any code, but it's fairly simple to write.

Solution 3

There is a simple way to do that with the hellotext sample. You can send the html by typing that into the text field.

<iframe src="http://mywebpage.com" style="width:1280px;height:720px"></iframe>

Solution 4

To provide extra info from the current answer, as this post comes up near top on most searches.

Thing to search for is Digital Signage, this is the sort of industry word.

following GreenScreen Chromecast works okay. Greenscreen

host solution is Sign Simple - which looks to be same approach as Greenscreen without you needing to host the receiver web page.

Similar hosted solutions using Raspberry Pi can be found.

Of note: with GreenScreen and the CastHelloText, I could not get 1080p only 720p, some comments mention Video only in 1080p, but Images in 720p, which I take to mean html pages aswell.

Solution 5

Chromecast can indeed be used to display an arbitrary URL.

This can be done from plain old Chrome, using 'url-cast-receiver'. (Usable 'demo' page, GitHub project page.)

Share:
31,923

Related videos on Youtube

kbriggs
Author by

kbriggs

Updated on December 09, 2020

Comments

  • kbriggs
    kbriggs over 3 years

    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?

  • pushmatrix
    pushmatrix about 10 years
    Unfortunately I think it's against the ToS :(
  • silvamerica
    silvamerica about 10 years
    @pushmatrix Do you know where in the ToS it says that this would be a violation?
  • Max Barraclough
    Max Barraclough almost 6 years
    @pushmatrix I presume you're referring to "you must take appropriate steps to ensure that your application cannot be invoked to launch content for which you are not responsible", which would prohibit casting a user-specified URL.
  • Harald
    Harald about 5 years
    The github link is broken.
  • DeDenker
    DeDenker almost 5 years
    Google removed his repo, here are some clones: * github.com/mgile/CastHelloVideo-chrome * github.com/olibye/castrax * github.com/davestevens/chromecast-webpage-viewer I did not compare code.
  • Grasper
    Grasper about 4 years
    My site has a login page and the chromecast won't pass this page when casting. Is there a way to sync the logged in session with the sent URL?
  • Max Barraclough
    Max Barraclough about 4 years
    @Grasper I believe that the Chrome browser supports 'mirroring' onto the Chromecast, but that's a video-stream, it's not merely steering the Chromecast. To properly support Chromecast, I believe you have no option but to build this into the site itself. There are tutorials available for Chromecast development.