默认的chromecast接收器应用程序将无法加载

时间:2018-04-21 01:36:09

标签: google-cast google-cast-sdk

我正在尝试运行https://developers.google.com/cast/docs/caf_receiver_basic#google_caf_receiver_sdk_google-caf-receiver-sdk上提供的默认接收器应用程序。当我尝试在Chrome 65中加载接收器时,它会在控制台中引发错误: r_new.html:4 GET file://www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js net::ERR_FILE_NOT_FOUND

r_new.html:10 Uncaught ReferenceError: cast is not defined at r_new.html:10 (anonymous) @ r_new.html:10

我知道协议//不可知的URL。如果我将其更改为https://,则会加载第一个脚本,然后在其余脚本上失败。这可能是安全问题或开发人员问题,但我不确定如何纠正它。

更新

使用节点http-server(https://www.npmjs.com/package/http-server)和以下说明https://stackoverflow.com/a/44058453/3997521在Chrome 65 OSX上为我的本地主机服务器成功生成证书:http-server -S -C MyCompanyLocalhost.cer -K MyCompanyLocalhost.pvk -o

注意:不要忘记安装MyCompanyCA.cer以匹配并重新启动chrome,它将获得证书。

即使使用index.html文件正确加载页面,我仍然会收到以下错误:

Uncaught TypeError: Cannot read property 'setTouchInputSupport' of undefined at Object.cast.receiver.platform.setTouchInputSupport (cast_receiver_framework.js:81) at Af (cast_receiver_framework.js:116) at T.start (cast_receiver_framework.js:483) at localhost/:10

更新2:Windows的结果与正确配置的证书相同

receiver.html:63 Starting receiver application cast_receiver.js:89 [ 0.000s] [cast.receiver.IpcChannel] Opening net websocket cast_receiver.js:89 [ 0.003s] [cast.receiver.CastReceiverManager] Version: 2.0.0.0061 cast_receiver.js:89 [ 0.005s] [cast.receiver.MediaManager] Using default Player receiver.html:68 Starting receiver manager cast_receiver.js:115 Uncaught TypeError: Cannot read property 'setTouchInputSupport' of undefined at te (cast_receiver.js:115) at N.start (cast_receiver.js:97) at receiver.html:82

更新3:在具有真实配置证书的实时服务器上试用Chrome 66 Windows

cast.receiver.platform.setTouchInputSupport @ cast_receiver_framework.js:81 Af @ cast_receiver_framework.js:116 T.start @ cast_receiver_framework.js:483 (anonymous) @ reciever.html:10

2 个答案:

答案 0 :(得分:0)

你确定你没有写错字吗?尝试使用localhost。 如果您决定使用localhost,则需要运行服务器。 服务器运行时,请复制此示例:

本地主机/ myfiles的/ yourfile.yourcode

答案 1 :(得分:0)

我从未见过这个错误,并且在4月份出现了这个错误。看起来谷歌添加了一些代码来检查平台。 参考新闻goole first change chromecast prevent amazon

此错误会阻止castManager在localhost:8008上启动ws连接 在真正的chromecast中,没有这个错误就没关系。