How can I draw an HTML page with Google Cast Chrome extension?

I am creating a simple web application that I want to display on my TV using the Google Cast SDK, Chrome browser and Chromecast. I know with the Chromecast extension for the Chrome browser, I can make a tab on the Chromecast device that works fine from my laptop. However, I want this exact same functionality, but available on iOS devices (iPads and iPhones) that work with the Chrome browser.

With Chrome v36, Cast seems to have baked into the iOS version of Chrome. I put the following instructions into the Google Cast SDK: https://developers.google.com/cast/docs/chrome_sender . I can get my iPad to connect to Chromecast, but when I try to transfer the URL to a web page ...

var mediaInfo = new chrome.cast.media.MediaInfo('http://google.com'); var request = new chrome.cast.media.LoadRequest(mediaInfo); session.loadMedia(request, onMediaDiscovered.bind(this, 'loadMedia'), onMediaError); 

I get an error message ...

INVALID_PARAMETER

I found other, somewhat outdated examples, saying that I can create my own Cast receiver that contains an iFrame and displays the page there, but I don't want to create a custom receiver.

Can I only do this with Cast Sender?

+5
source share
2 answers

You always need a lame receiver; this is what loads there. In general, you can use the default receiver / style or custom. Default or Styled receivers can only handle media, so you are left with the Custom option and the IFrame is the way to go.

+1
source

Chrome on iOS does not support casting. There, a post from the beginning of 2016 says this on google product forums. (But my reputation is too low to post more than two links).

If it works, then you only need this site and select the ChromeCast option and click "Run" after entering your website. This works on Chrome on the desktop.

The source for this sender / receiver is here: https://github.com/boombatower/chromecast-dashboard

I used the boombatower.imtqy.com receiver with my own code as the sender in the iOS app. I also see if the application extension will work, but I suspect it is not due to the limitations of the application extension.

+1
source

Source: https://habr.com/ru/post/1207339/


All Articles