我需要知道在实施IVideoCastConsumer时在何处定义onFailed(int resourceId, int statusCode)状态代码
谢谢。
发布于 2014-05-29 23:44:40
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中定义。请注意,有时没有状态代码。
https://stackoverflow.com/questions/23934853
复制相似问题