调试Chromecast Receiver App(设备不支持平台API)

met*_*hai 4 google-cast chromecast

根据端口9222上的调试面板,我有一个接收器应用程序(来自cast-ios-sample的库存版本)正确地从我列入白名单的URI下载.但是,控制台很快就会从google的托管的cast_receiver.js中吐出这些行. (在receiver.html文件中引用)

[  0.162s] [goog.net.WebSocket] An error occurred: undefined
[  0.172s] [cast.receiver.ChannelOverWebSocket] Dispatch ERROR event to ws://localhost:8008/system/control
[  0.177s] [cast.receiver.Channel] Dispatch ERROR event to ws://localhost:8008/system/control
[  0.182s] [cast.receiver.Platform] Platform channel has an error: ws://localhost:8008/system/control
Run Code Online (Sandbox Code Playgroud)

然后在一系列这些错误之后(可能是在重试循环中):

[  8.335s] [cast.receiver.Platform] This device doesn't support the platform API.
Run Code Online (Sandbox Code Playgroud)

如果我尝试手动建立与ws:// localhost:8008/system/control的WebSocket连接,我只是得到一个未定义的响应.

有什么东西我不见了吗?

met*_*hai 6

事实证明,在receiver.html示例中,Receiver也需要您的AppID.我没有在任何说明中看到这一点,所以我在这里发布答案,如果它可以帮助某人.

cast.receiver.Receiver(activityName...)
Run Code Online (Sandbox Code Playgroud)

显然,activityName实际上是AppID,通过放置我的AppID(而不是命名我的应用程序,我错误地认为),它现在工作正常.