Builder

class Builder
kotlin.Any
   ↳ androidx.mediarouter.media.MediaRouteDescriptor.Builder

Builder for media route descriptors.

Summary

Public constructors

<init>(id: String!, name: String!)

Creates a media route descriptor builder.

Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.

Public methods

MediaRouteDescriptor.Builder!

Adds a media control intent filter for the route.

MediaRouteDescriptor.Builder!

Adds a list of media control intent filters for the route.

MediaRouteDescriptor!

Builds the media route descriptor.

MediaRouteDescriptor.Builder!
setCanDisconnect(canDisconnect: Boolean)

Sets whether the route can be disconnected without stopping playback.

MediaRouteDescriptor.Builder!
setConnecting(connecting: Boolean)

Sets whether the route is in the process of connecting and is not yet ready for use.

MediaRouteDescriptor.Builder!
setConnectionState(connectionState: Int)

Sets the route's connection state.

MediaRouteDescriptor.Builder!
setDescription(description: String!)

Sets the user-visible description of the route.

MediaRouteDescriptor.Builder!
setDeviceType(deviceType: Int)

Sets the route's receiver device type.

MediaRouteDescriptor.Builder!
setEnabled(enabled: Boolean)

Sets whether the route is enabled.

MediaRouteDescriptor.Builder!
setExtras(extras: Bundle!)

Sets a bundle of extras for this route descriptor.

MediaRouteDescriptor.Builder!
setIconUri(iconUri: Uri!)

Sets the URI of the icon representing this route.

MediaRouteDescriptor.Builder!
setId(id: String!)

Sets the unique id of the route.

MediaRouteDescriptor.Builder!
setIsDynamicGroupRoute(isDynamicGroupRoute: Boolean)

Sets whether the route is a dynamic group route.

MediaRouteDescriptor.Builder!
setName(name: String!)

Sets the user-visible name of the route.

MediaRouteDescriptor.Builder!
setPlaybackStream(playbackStream: Int)

Sets the route's playback stream.

MediaRouteDescriptor.Builder!
setPlaybackType(playbackType: Int)

Sets the route's playback type.

MediaRouteDescriptor.Builder!
setPresentationDisplayId(presentationDisplayId: Int)

Sets the route's presentation display id, or -1 if none.

MediaRouteDescriptor.Builder!

Sets an intent sender for launching the settings activity for this route.

MediaRouteDescriptor.Builder!
setVolume(volume: Int)

Sets the route's current volume, or 0 if unknown.

MediaRouteDescriptor.Builder!
setVolumeHandling(volumeHandling: Int)

Sets the route's volume handling.

MediaRouteDescriptor.Builder!
setVolumeMax(volumeMax: Int)

Sets the route's maximum volume, or 0 if unknown.

Public constructors

<init>

Builder(id: String!, name: String!)

Creates a media route descriptor builder.

Parameters
id String!: The unique id of the route.
name String!: The user-visible name of the route.

<init>

Builder(descriptor: MediaRouteDescriptor!)

Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.

Public methods

addControlFilter

fun addControlFilter(filter: IntentFilter!): MediaRouteDescriptor.Builder!

Adds a media control intent filter for the route.

addControlFilters

fun addControlFilters(filters: MutableCollection<IntentFilter!>!): MediaRouteDescriptor.Builder!

Adds a list of media control intent filters for the route.

build

fun build(): MediaRouteDescriptor!

Builds the media route descriptor.

setCanDisconnect

fun setCanDisconnect(canDisconnect: Boolean): MediaRouteDescriptor.Builder!

Sets whether the route can be disconnected without stopping playback.

setConnecting

fun setConnecting(connecting: Boolean): MediaRouteDescriptor.Builder!

Deprecated: Use setConnectionState instead.

Sets whether the route is in the process of connecting and is not yet ready for use.

setConnectionState

fun setConnectionState(connectionState: Int): MediaRouteDescriptor.Builder!

Sets the route's connection state.

Parameters
connectionState Int: The connection state of the route: MediaRouter.RouteInfo#CONNECTION_STATE_DISCONNECTED, MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTING, or MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTED.

setDescription

fun setDescription(description: String!): MediaRouteDescriptor.Builder!

Sets the user-visible description of the route.

The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device.

setDeviceType

fun setDeviceType(deviceType: Int): MediaRouteDescriptor.Builder!

Sets the route's receiver device type.

Parameters
deviceType Int: The receive device type of the route: MediaRouter.RouteInfo#DEVICE_TYPE_TV or MediaRouter.RouteInfo#DEVICE_TYPE_SPEAKER.

setEnabled

fun setEnabled(enabled: Boolean): MediaRouteDescriptor.Builder!

Sets whether the route is enabled.

Disabled routes represent routes that a route provider knows about, such as paired Wifi Display receivers, but that are not currently available for use.

setExtras

fun setExtras(extras: Bundle!): MediaRouteDescriptor.Builder!

Sets a bundle of extras for this route descriptor. The extras will be ignored by the media router but they may be used by applications.

setIconUri

fun setIconUri(iconUri: Uri!): MediaRouteDescriptor.Builder!

Sets the URI of the icon representing this route.

This icon will be used in picker UIs if available.

The URI must be one of the following formats:

setId

fun setId(id: String!): MediaRouteDescriptor.Builder!

Sets the unique id of the route.

The route id associated with a route descriptor functions as a stable identifier for the route and must be unique among all routes offered by the provider.

setIsDynamicGroupRoute

fun setIsDynamicGroupRoute(isDynamicGroupRoute: Boolean): MediaRouteDescriptor.Builder!

Sets whether the route is a dynamic group route.

setName

fun setName(name: String!): MediaRouteDescriptor.Builder!

Sets the user-visible name of the route.

The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.

setPlaybackStream

fun setPlaybackStream(playbackStream: Int): MediaRouteDescriptor.Builder!

Sets the route's playback stream.

setPlaybackType

fun setPlaybackType(playbackType: Int): MediaRouteDescriptor.Builder!

Sets the route's playback type.

Parameters
playbackType Int: The playback type of the route: MediaRouter.RouteInfo#PLAYBACK_TYPE_LOCAL or MediaRouter.RouteInfo#PLAYBACK_TYPE_REMOTE.

setPresentationDisplayId

fun setPresentationDisplayId(presentationDisplayId: Int): MediaRouteDescriptor.Builder!

Sets the route's presentation display id, or -1 if none.

setSettingsActivity

fun setSettingsActivity(is: IntentSender!): MediaRouteDescriptor.Builder!

Sets an intent sender for launching the settings activity for this route.

setVolume

fun setVolume(volume: Int): MediaRouteDescriptor.Builder!

Sets the route's current volume, or 0 if unknown.

setVolumeHandling

fun setVolumeHandling(volumeHandling: Int): MediaRouteDescriptor.Builder!

Sets the route's volume handling.

Parameters
volumeHandling Int: how volume is handled on the route: MediaRouter.RouteInfo#PLAYBACK_VOLUME_FIXED or MediaRouter.RouteInfo#PLAYBACK_VOLUME_VARIABLE.

setVolumeMax

fun setVolumeMax(volumeMax: Int): MediaRouteDescriptor.Builder!

Sets the route's maximum volume, or 0 if unknown.