Media route providers are used to publish additional media routes for use within an application. Media route providers may also be declared as a service to publish additional media routes to all applications in the system.
The purpose of a media route provider is to discover media routes that satisfy
the criteria specified by the current
MediaRouteDiscoveryRequest and publish a
MediaRouteProviderDescriptor with information about each route by calling
setDescriptor(MediaRouteProviderDescriptor) to notify the currently registered
The provider should watch for changes to the discovery request by implementing
onDiscoveryRequestChanged(MediaRouteDiscoveryRequest) and updating the set of routes that it is
attempting to discover. It should also handle route control requests such
as volume changes or
media control intents
onCreateRouteController(String) to return a
for a particular route.
A media route provider can support
dynamic group that
allows the user to add or remove a route from the selected route dynamically.
To control dynamic group,
MediaRouteProvider.DynamicGroupRouteController returned by
onCreateDynamicGroupRouteController(String) is used instead of
A media route provider may be used privately within the scope of a single
application process by calling
to add it to the local
MediaRouter. A media route provider may also be made
available globally to all applications by registering a
in the provider's manifest. When the media route provider is registered
as a service, all applications that use the media router API will be able to
discover and used the provider's routes without having to install anything else.
This object must only be accessed on the main thread.
Callback which is invoked when route information becomes available or changes.
Provides control over a dynamic group route.
Describes properties of the route provider's implementation.
Provides control over a particular route.
Creates a media route provider.