CCL IVideoCastConsumer onFailed状态代码在哪里定义?

时间:2014-05-29 13:43:42

标签: chromecast google-cast

我需要知道在实施onFailed(int resourceId, int statusCode)时定义的IVideoCastConsumer状态代码在哪里?

感谢。

1 个答案:

答案 0 :(得分:0)

resourceId指向可用于失败的“默认”消息。以下是(当前)默认资源的列表(在CCL中查看res/values/strings.xml);他们可以在你自己的项目中被覆盖:

<!-- Failures -->
<string name="failed_to_connect">Could not connect to the device</string>
<string name="failed_setting_volume">Failed to set the volume</string>
<string name="failed_no_connection">No connection to the cast device is present</string>
<string name="failed_no_connection_short">No connection</string>
<string name="failed_no_connection_trans">Connection to the cast device has been lost. Application is trying to re-establish the connection, if possible. Please wait for a few seconds and try again.</string>
<string name="failed_perform_action">Failed to perform the action</string>
<string name="failed_status_request">Failed to sync up with the cast device</string>
<string name="failed_load">Failed to load media on the cast device</string>
<string name="failed_seek">Failed to seek to the new position on the cast device</string>
<string name="failed_receiver_player_error">Receiver player has encountered a sever error</string>
<string name="failed_authorization_timeout">Authorization timed out</string>

第二个参数statusCode指的是您正在执行的操作的状态代码;例如,如果您正在调用RemoteMediaPlayer.load(..),则ResultCallback会提供一个MediaChannelResult对象,该对象封装状态代码(可以通过getStatus().getStatusCode()获取)。这些状态代码主要在CastStatusCode中定义。请注意,有时没有状态代码。

相关问题