MediaRouteProvider.DynamicGroupRouteController


abstract class MediaRouteProvider.DynamicGroupRouteController : MediaRouteProvider.RouteController


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

Public constructors

Public functions

String?

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

String?

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

Unit

This function is deprecated.

Use notifyDynamicRoutesChanged instead to notify information of the group.

Unit

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

abstract Unit

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

abstract Unit

Called when a user removes a route from casting session.

abstract Unit

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

Inherited functions

From androidx.mediarouter.media.MediaRouteProvider.RouteController
Boolean
onControlRequest(
    intent: Intent,
    callback: MediaRouter.ControlRequestCallback?
)

Performs a media control request asynchronously on behalf of the route.

Unit

Releases the route controller, allowing it to free its resources.

Unit

Selects the route.

Unit
onSetVolume(volume: Int)

Requests to set the volume of the route.

Unit

This function is deprecated.

Use onUnselect instead.

Unit
onUnselect(reason: Int)

Unselects the route and provides a reason.

Unit

Requests an incremental volume update for the route.

Public constructors

DynamicGroupRouteController

Added in 1.1.0
DynamicGroupRouteController()

Public functions

getGroupableSelectionTitle

Added in 1.1.0
fun getGroupableSelectionTitle(): String?

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."

getTransferableSectionTitle

Added in 1.1.0
fun getTransferableSectionTitle(): String?

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."

notifyDynamicRoutesChanged

Added in 1.1.0
Deprecated in 1.2.0
fun notifyDynamicRoutesChanged(
    routes: (Mutable)Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor!>
): Unit

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: (Mutable)Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor!>

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

notifyDynamicRoutesChanged

Added in 1.2.0
fun notifyDynamicRoutesChanged(
    groupRoute: MediaRouteDescriptor,
    dynamicRoutes: (Mutable)Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor!>
): Unit

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: (Mutable)Collection<MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor!>

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

onAddMemberRoute

Added in 1.1.0
abstract fun onAddMemberRoute(routeId: String): Unit

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

onRemoveMemberRoute

Added in 1.1.0
abstract fun onRemoveMemberRoute(routeId: String): Unit

Called when a user removes a route from casting session.

onUpdateMemberRoutes

Added in 1.1.0
abstract fun onUpdateMemberRoutes(routeIds: (Mutable)List<String!>?): Unit

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