【发布时间】:2018-10-01 18:09:49
【问题描述】:
我正在尝试运行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
【问题讨论】:
标签: google-cast google-cast-sdk