如何投射带有Google Cast Chrome扩展程序的HTML页面? [英] How can I cast an HTML page with the Google Cast Chrome extension?

查看:144
本文介绍了如何投射带有Google Cast Chrome扩展程序的HTML页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个简单的Web应用程序,希望能够使用Google Cast SDK,Chrome浏览器和Chromecast在电视屏幕上显示。我知道,有了适用于Chrome浏览器的Chromecast扩展程序,我可以将标签页投射到Chromecast设备上,从我的笔记本电脑上可以完美运行。但是,我想要这个完全相同的功能,但是可以从运行Chrome浏览器的iOS设备(iPad和iPhone)获得。

I'm building a simple web application that I want to be able to display on a TV screen using the Google Cast SDK, the Chrome browser and a Chromecast. I know with the Chromecast extension for Chrome Browser, I can cast a tab to a Chromecast device, which, from my laptop works perfectly. However, I want this exact same functionality, but available from iOS devices (iPads and iPhones) running the Chrome Browser.

似乎自Chrome v36以来,Cast功能已被植入iOS版本的Chrome。我已按照以下说明提取了Google Cast SDK: https://developers.google.com/cast / docs / chrome_sender 。我可以将iPad连接到Chromecast,但是当我尝试将URL传递到网页时...

It seems since Chrome v36 the Cast ability is baked into the iOS versions of Chrome. I have pulled in the Google Cast SDK per these instructions: https://developers.google.com/cast/docs/chrome_sender. I am able to get my iPad to connect to the Chromecast, but when I try to pass in a 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);

我遇到错误...


invalid_parameter

invalid_parameter

我发现了其他一些过时的示例,说我可以构建一个自定义的Cast Receiver拥有一个iFrame并在其中呈现页面,但我不想构建自定义的Cast Receiver。

I have found other, somewhat dated examples, saying I can build a custom Cast Receiver that holds an iFrame and renders the page in there, but I do not want to build a custom Cast Receiver.

我可以仅使用Cast发件人吗?

Can I accomplish this with just a Cast Sender?

推荐答案

chromecast上始终需要一个接收器;那就是那里加载的东西。通常,您可以使用默认/样式接收器,也可以使用自定义接收器。 默认或样式接收器只能处理媒体,因此您可以选择自定义选项,然后使用iframe。

You always need a receiver on the chromecast; that is what gets loaded there. In general, you can either use a default/styled receiver or a custom one. The Default or Styled receivers can only handle media so you are left with the Custom option and having an iframe is the way to go.

这篇关于如何投射带有Google Cast Chrome扩展程序的HTML页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆