我正在尝试运行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