Display web sites and web apps with Chromecast

主宰稳场 提交于 2019-11-28 04:43:31
kbriggs

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.

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.

Luis Gar

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>

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!