1
votes

Can I use the Default Media Receiver to display a web page or an HTML5 app? Using Javascript in the Chrome browser, I have no problem sending a single png image (content type image/png) to the Chromecast but it fails if I specify an html link (content type text/html). session.loadMedia will fire the error handler and e.code/e.description reports session_error/LOAD_FAILED. I used Google's home page for my test:

//var currentMediaURL = "https://www.google.com/images/srpr/logo11w.png";
//var currentMediaType = "image/png";
var currentMediaURL = "https://www.google.com";
var currentMediaType = "text/html";

function startApp()
{
  var mediaInfo = new chrome.cast.media.MediaInfo(currentMediaURL, currentMediaType);
  var request = new chrome.cast.media.LoadRequest(mediaInfo);
  session.loadMedia(request, onMediaDiscovered.bind(this, 'loadMedia'), onMediaError);
};
1

1 Answers

3
votes

I think you need to have custom receiver, just have it run your code accordingly...