3

我正在尝试运行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成功为我的本地主机服务器生成证书后铬 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

4

2 回答 2

0

我从来没有见过这个错误,并且在四月份这个错误突然出现了。看起来谷歌添加了一些代码来检查平台。参考新闻goole 首先更改 chromecast 防止亚马逊

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

于 2018-04-26T03:45:07.020 回答
0

你确定你没有打错字?尝试使用本地主机。如果您决定使用 localhost,那么您将需要运行服务器。当您的服务器正在运行时,请复制此示例:

本地主机/myfiles/yourfile.yourcode

于 2018-04-21T01:50:56.440 回答