Google 致力于为黑人社区推动种族平等。查看具体举措

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

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(MediaRouteDescriptor groupRoute, Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor> dynamicRoutes)

Sets the group route descriptor and the dynamic route descriptors for the dynamic group.

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

This method is deprecated. Use notifyDynamicRoutesChanged(MediaRouteDescriptor, Collection) instead to notify information of the group.

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

DynamicGroupRouteController

public 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 (MediaRouteDescriptor groupRoute, 
                Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor> dynamicRoutes)

Sets the group route descriptor and the dynamic route descriptors for the dynamic group.

The dynamic group controller should call this method to notify the current dynamic group state.

Parameters
groupRoute MediaRouteDescriptor: The media route descriptor describing the dynamic group. The selected route of the media router will contain this information. If it is disabled, the media router will unselect the dynamic group and release the route controller.

dynamicRoutes Collection: The dynamic route descriptors for published routes. At least a selected or selecting route should be included.

notifyDynamicRoutesChanged

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

This method is deprecated.
Use notifyDynamicRoutesChanged(MediaRouteDescriptor, Collection) instead to notify information of the group.

Sets the dynamic route descriptors for the dynamic group.

The dynamic group controller should call this method to notify the current dynamic group state.

Parameters
routes Collection: The dynamic route descriptors for published routes. At least a selected or selecting route must be included.

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