public abstract class

MediaRouter.Callback

extends java.lang.Object

 java.lang.Object

↳androidx.mediarouter.media.MediaRouter.Callback

Overview

Interface for receiving events about media routing changes. All methods of this interface will be called from the application's main thread.

A Callback will only receive events relevant to routes that the callback was registered for unless the MediaRouter.CALLBACK_FLAG_UNFILTERED_EVENTS flag was specified in MediaRouter.addCallback(MediaRouteSelector, MediaRouter.Callback, int).

Summary

Constructors
publicCallback()

Methods
public voidonProviderAdded(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a media route provider has been added.

public voidonProviderChanged(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a property of the indicated media route provider has changed.

public voidonProviderRemoved(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a media route provider has been removed.

public voidonRouteAdded(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route has been added.

public voidonRouteChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a property of the indicated media route has changed.

public voidonRoutePresentationDisplayChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route's presentation display changes.

public voidonRouteRemoved(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route has been removed.

public voidonRouterParamsChanged(MediaRouter router, MediaRouterParams params)

public voidonRouteSelected(MediaRouter router, MediaRouter.RouteInfo route)

Called when the supplied media route becomes selected as the active route.

public voidonRouteSelected(MediaRouter router, MediaRouter.RouteInfo route, int reason)

Called when the supplied media route becomes selected as the active route.

public voidonRouteSelected(MediaRouter router, MediaRouter.RouteInfo selectedRoute, int reason, MediaRouter.RouteInfo requestedRoute)

Called when the supplied media route becomes selected as the active route, which may be different from the route requested by MediaRouter.selectRoute(MediaRouter.RouteInfo).

public voidonRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route)

Called when the supplied media route becomes unselected as the active route.

public voidonRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route, int reason)

Called when the supplied media route becomes unselected as the active route.

public voidonRouteVolumeChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route's volume changes.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Callback()

Methods

public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo route)

Deprecated: Use MediaRouter.Callback instead.

Called when the supplied media route becomes selected as the active route.

Parameters:

router: The media router reporting the event.
route: The route that has been selected.

public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo route, int reason)

Called when the supplied media route becomes selected as the active route.

The reason provided will be one of the following:

Parameters:

router: The media router reporting the event.
route: The route that has been selected.
reason: The reason for unselecting the previous route.

public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo selectedRoute, int reason, MediaRouter.RouteInfo requestedRoute)

Called when the supplied media route becomes selected as the active route, which may be different from the route requested by MediaRouter.selectRoute(MediaRouter.RouteInfo). That can happen when media transfer feature is enabled. The default implementation calls MediaRouter.Callback with the actually selected route.

Parameters:

router: The media router reporting the event.
selectedRoute: The route that has been selected.
reason: The reason for unselecting the previous route.
requestedRoute: The route that was requested to be selected.

public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route)

Deprecated: Use MediaRouter.Callback instead.

Called when the supplied media route becomes unselected as the active route. For detailed reason, override MediaRouter.Callback instead.

Parameters:

router: The media router reporting the event.
route: The route that has been unselected.

public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route, int reason)

Called when the supplied media route becomes unselected as the active route. The default implementation calls MediaRouter.Callback.onRouteUnselected(MediaRouter, MediaRouter.RouteInfo).

The reason provided will be one of the following:

Parameters:

router: The media router reporting the event.
route: The route that has been unselected.
reason: The reason for unselecting the route.

public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route has been added.

Parameters:

router: The media router reporting the event.
route: The route that has become available for use.

public void onRouteRemoved(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route has been removed.

Parameters:

router: The media router reporting the event.
route: The route that has been removed from availability.

public void onRouteChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a property of the indicated media route has changed.

Parameters:

router: The media router reporting the event.
route: The route that was changed.

public void onRouteVolumeChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route's volume changes.

Parameters:

router: The media router reporting the event.
route: The route whose volume changed.

public void onRoutePresentationDisplayChanged(MediaRouter router, MediaRouter.RouteInfo route)

Called when a media route's presentation display changes.

This method is called whenever the route's presentation display becomes available, is removed or has changes to some of its properties (such as its size).

Parameters:

router: The media router reporting the event.
route: The route whose presentation display changed.

See also: MediaRouter.RouteInfo.getPresentationDisplay()

public void onProviderAdded(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a media route provider has been added.

Parameters:

router: The media router reporting the event.
provider: The provider that has become available for use.

public void onProviderRemoved(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a media route provider has been removed.

Parameters:

router: The media router reporting the event.
provider: The provider that has been removed from availability.

public void onProviderChanged(MediaRouter router, MediaRouter.ProviderInfo provider)

Called when a property of the indicated media route provider has changed.

Parameters:

router: The media router reporting the event.
provider: The provider that was changed.

public void onRouterParamsChanged(MediaRouter router, MediaRouterParams params)