public static abstract class MediaRouter.Callback
extends Object
java.lang.Object | |
↳ | android.support.v7.media.MediaRouter.Callback |
用于接收有关媒体路由更改事件的接口。 该接口的所有方法都将从应用程序的主线程中调用。
回调只会收到相关的回调被注册,除非路线事件 CALLBACK_FLAG_UNFILTERED_EVENTS
在指定标志 addCallback(MediaRouteSelector, Callback, int)
。
Public constructors |
|
---|---|
MediaRouter.Callback() |
Inherited methods |
|
---|---|
From class java.lang.Object
|
MediaRouter.Callback ()
void onProviderAdded (MediaRouter router, MediaRouter.ProviderInfo provider)
在添加媒体路由提供程序时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
provider |
MediaRouter.ProviderInfo : The provider that has become available for use. |
void onProviderChanged (MediaRouter router, MediaRouter.ProviderInfo provider)
当指定媒体路线提供者的属性发生变化时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
provider |
MediaRouter.ProviderInfo : The provider that was changed. |
void onProviderRemoved (MediaRouter router, MediaRouter.ProviderInfo provider)
当媒体路由提供商被删除时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
provider |
MediaRouter.ProviderInfo : The provider that has been removed from availability. |
void onRouteAdded (MediaRouter router, MediaRouter.RouteInfo route)
在添加媒体路由时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that has become available for use. |
void onRouteChanged (MediaRouter router, MediaRouter.RouteInfo route)
当指定媒体路线的属性发生变化时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that was changed. |
void onRoutePresentationDisplayChanged (MediaRouter router, MediaRouter.RouteInfo route)
当媒体路线的演示显示更改时调用。
只要路由的演示文稿显示变得可用,被删除或对其某些属性(例如其大小)进行了更改,就会调用此方法。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route whose presentation display changed. |
也可以看看:
void onRouteRemoved (MediaRouter router, MediaRouter.RouteInfo route)
当媒体路线已被删除时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that has been removed from availability. |
void onRouteSelected (MediaRouter router, MediaRouter.RouteInfo route)
当提供的媒体路由被选为活动路由时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that has been selected. |
void onRouteUnselected (MediaRouter router, MediaRouter.RouteInfo route)
当提供的媒体路由变为未选中作为活动路由时调用。 详细原因, onRouteUnselected(MediaRouter, RouteInfo, int)
改为onRouteUnselected(MediaRouter, RouteInfo, int)
。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that has been unselected. |
void onRouteUnselected (MediaRouter router, MediaRouter.RouteInfo route, int reason)
当提供的媒体路由变为未选中作为活动路由时调用。 默认实现调用onRouteUnselected(MediaRouter, MediaRouter.RouteInfo)
。
提供的原因将是以下之一:
UNSELECT_REASON_UNKNOWN
UNSELECT_REASON_DISCONNECTED
UNSELECT_REASON_STOPPED
UNSELECT_REASON_ROUTE_CHANGED
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route that has been unselected. |
reason |
int : The reason for unselecting the route. |
void onRouteVolumeChanged (MediaRouter router, MediaRouter.RouteInfo route)
当媒体路线的音量变化时调用。
Parameters | |
---|---|
router |
MediaRouter : The media router reporting the event. |
route |
MediaRouter.RouteInfo : The route whose volume changed. |