Cast Session终止,错误代码为2005

时间:2016-12-02 19:14:06

标签: android google-cast

我正在尝试构建一个非常基本的概念证明转换应用程序,并且我的Cast会话结束错误代码2005 APPLICATION_NOT_RUNNING。

使用默认媒体接收器应用程序ID有效。会话连接得很好并播放内容。

但是,当应用ID通过Google Cast SDK Developer Console注册为远程显示接收器时,强制转换会话在启动后会突然终止,如日志中所示:

12-02 11:51:12.458 19515-8203/? I/CastService: [instance-65] onApplicationConnected: com.company.app applicationId: 80F9586X, name: Company, images.count: 0, namespaces.count: 4, senderAppIdentifier: null, senderAppLaunchUrl: null Flipgrid 8c487445-82cc-4801-8c5d-8084cfacb4dd true
12-02 11:51:12.489 19068-19068/com.company.app W/CastActivity: onSessionStarted
12-02 11:51:12.563 19515-8203/? I/CastDeviceController: [controller-0291 RCNController] calling Listener.onConnected(true)
12-02 11:51:12.608 19515-8203/? I/CastDeviceController: [controller-0291 RCNController] joinApplicationInternal: appId:80F9586X sessionId: joinOptions:joinOptions(connectionType=INVISIBLE)
12-02 11:51:12.620 19515-8203/? I/CastDeviceController: [controller-0291 RCNController] joinApplicationInternal: appId:80F9586X sessionId: joinOptions:joinOptions(connectionType=INVISIBLE)
12-02 11:51:12.627 19515-8203/? I/CastDeviceController: [controller-0291 RCNController] finishDisconnecting; socketError="0 No error", mDisconnectStatusCode=SUCCESS
12-02 11:51:12.627 19515-8203/? I/CastDeviceController: [controller-0291 RCNController] listener.onDisconnected(SUCCESS)
12-02 11:51:13.159 946-1701/? D/ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 142]
12-02 11:51:13.588 19515-8203/? I/CastDeviceController: [controller-0292 RCNController] calling Listener.onConnected(true)
12-02 11:51:13.629 19515-8203/? I/CastDeviceController: [controller-0292 RCNController] joinApplicationInternal: appId:80F9586X sessionId: joinOptions:joinOptions(connectionType=INVISIBLE)
12-02 11:51:13.643 19515-8203/? I/CastDeviceController: [controller-0292 RCNController] joinApplicationInternal: appId:80F9586X sessionId: joinOptions:joinOptions(connectionType=INVISIBLE)
12-02 11:51:13.652 19515-8203/? I/CastDeviceController: [controller-0292 RCNController] finishDisconnecting; socketError="0 No error", mDisconnectStatusCode=SUCCESS
12-02 11:51:13.652 19515-8203/? I/CastDeviceController: [controller-0292 RCNController] listener.onDisconnected(SUCCESS)
12-02 11:51:15.068 377-1305/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback speaker
12-02 11:51:15.072 377-1305/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
12-02 11:51:17.590 19515-8203/? I/CastDeviceController: [controller-0289 API] listener.onApplicationDisconnected(APPLICATION_NOT_RUNNING)
12-02 11:51:17.593 19515-8203/? I/CastService: [instance-65] onApplicationDisconnected: com.company.app 8c487445-82cc-4801-8c5d-8084cfacb4dd APPLICATION_NOT_RUNNING
12-02 11:51:17.596 19068-19068/com.company.app E/AudioAttributes: Invalid stream type -1 for AudioAttributes`
12-02 11:51:17.696 19068-19068/com.company.app W/CastActivity: onSessionEnded error=2005 APPLICATION_NOT_RUNNING

关于可能出现错误的任何想法?

1 个答案:

答案 0 :(得分:2)

如果你正在播放媒体而没有做RemoteDisplay(似乎就是这种情况),你应该使用Styled接收器,Default接收器或你自己的定制接收器;远程显示接收器用于远程显示API(允许您在电视上显示发件人应用程序中的视图),而不是常规演员应用程序。