Register now for Android Dev Summit 2019!

MediaRouteProvider.DynamicGroupRouteController

public static abstract class MediaRouteProvider.DynamicGroupRouteController
extends MediaRouteProvider.RouteController

java.lang.Object
   ↳ androidx.mediarouter.media.MediaRouteProvider.RouteController
     ↳ androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController


Provides control over a dynamic group route. A dynamic group route is a group of routes such that a route can be added or removed from the group by the user dynamically.

Summary

Nested classes

class MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor

Contains a route, its selection state and its capabilities. 

Public constructors

MediaRouteProvider.DynamicGroupRouteController()

Public methods

String getGroupableSelectionTitle()

Gets the title of the groupable routes section which will be shown to the user.

String getTransferableSectionTitle()

Gets the title of the transferable routes section which will be shown to the user.

final void notifyDynamicRoutesChanged(Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor> routes)

Sets the dynamic route descriptors for routes.

abstract void onAddMemberRoute(String routeId)

Called when a user adds a route into the casting session.

abstract void onRemoveMemberRoute(String routeId)

Called when a user removes a route from casting session.

abstract void onUpdateMemberRoutes(List<String> routeIds)

Called when a user selects a new set of routes s/he wants the session to be played.

Inherited methods

Public constructors

MediaRouteProvider.DynamicGroupRouteController

public MediaRouteProvider.DynamicGroupRouteController ()

Public methods

getGroupableSelectionTitle

public String getGroupableSelectionTitle ()

Gets the title of the groupable routes section which will be shown to the user. It is provided by MediaRouteProvider. e.g. "Add a device."

Returns
String

getTransferableSectionTitle

public String getTransferableSectionTitle ()

Gets the title of the transferable routes section which will be shown to the user. It is provided by MediaRouteProvider. MediaRouteProvider. e.g. "Play on group."

Returns
String

notifyDynamicRoutesChanged

public final void notifyDynamicRoutesChanged (Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor> routes)

Sets the dynamic route descriptors for routes.

The dynamic group controller must call this method to notify the current dynamic group state of routes.

Parameters
routes Collection: The dynamic route descriptors for published routes.

onAddMemberRoute

public abstract void onAddMemberRoute (String routeId)

Called when a user adds a route into the casting session.

Parameters
routeId String

onRemoveMemberRoute

public abstract void onRemoveMemberRoute (String routeId)

Called when a user removes a route from casting session.

Parameters
routeId String

onUpdateMemberRoutes

public abstract void onUpdateMemberRoutes (List<String> routeIds)

Called when a user selects a new set of routes s/he wants the session to be played.

Parameters
routeIds List