Google is committed to advancing racial equity for Black communities. See how.

RouteInfo

class RouteInfo
kotlin.Any
   ↳ androidx.mediarouter.media.MediaRouter.RouteInfo

Provides information about a media route.

Each media route has a list of media control intent filters that describe the capabilities of the route and the manner in which it is used and controlled.

Summary

Constants
static Int

A connection state indicating the route is connected.

static Int

A connection state indicating the route is in the process of connecting and is not yet ready for use.

static Int

The default connection state indicating the route is disconnected.

static Int

A receiver device type of the route indicating the presentation of the media is happening on a speaker.

static Int

A receiver device type of the route indicating the presentation of the media is happening on a TV.

static Int

The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. a phone, a tablet) as where it is controlled from.

static Int

A playback type indicating the presentation of the media is happening on a different device (i.e. the remote device) than where it is controlled from.

static Int

Playback information indicating the playback volume is fixed, i.

static Int

Playback information indicating the playback volume is variable and can be controlled from this object.

Public methods
open Boolean

Gets whether this route supports disconnecting without interrupting playback.

open Int

Gets the connection state of the route.

open MutableList<IntentFilter!>!

Gets a list of media control intent filters that describe the capabilities of this route and the media control actions that it supports.

open String?

Gets the user-visible description of the route.

open Int

Gets the type of the receiver device associated with this route.

open Bundle?

Gets a collection of extra properties about this route that were supplied by its media route provider, or null if none.

open Uri!

Gets the URI of the icon representing this route.

open String

Gets the unique id of the route.

open String!

Gets the user-visible name of the route.

open Int

Gets the audio stream over which the playback associated with this route is performed.

open Int

Gets the type of playback associated with this route.

open Display?

Gets the Display that should be used by the application to show a android.app.Presentation on an external display when this route is selected.

open MediaRouter.ProviderInfo!

Gets information about the provider of this media route.

open IntentSender?

Gets an intent sender for launching a settings activity for this route.

open Int

Gets the current volume for this route.

open Int

Gets information about how volume is handled on the route.

open Int

Gets the maximum volume at which the playback associated with this route is performed.

open Boolean

Returns true if this route is a bluetooth route.

open Boolean

Returns true if the route is in the process of connecting and is not yet ready for use.

open Boolean

Returns true if this route is the default route.

open Boolean

Returns true if this route is the default route and the device speaker.

open Boolean

Returns true if this route is enabled and may be selected.

open Boolean

Returns true if this route is currently selected.

open Boolean
matchesSelector(@NonNull selector: MediaRouteSelector)

Returns true if the route supports at least one of the capabilities described by a media route selector.

open Unit

Requests a volume change for this route asynchronously.

open Unit

Requests an incremental volume update for this route asynchronously.

open Unit

Selects this media route.

open Unit
sendControlRequest(@NonNull intent: Intent, @Nullable callback: MediaRouter.ControlRequestCallback?)

Sends a media control request to be performed asynchronously by the route's destination.

open Boolean
supportsControlAction(@NonNull category: String, @NonNull action: String)

Returns true if the route supports the specified media control category and action.

open Boolean
supportsControlCategory(@NonNull category: String)

Returns true if the route supports the specified media control category.

open Boolean
supportsControlRequest(@NonNull intent: Intent)

Returns true if the route supports the specified media control request.

open String

Constants

CONNECTION_STATE_CONNECTED

static val CONNECTION_STATE_CONNECTED: Int

A connection state indicating the route is connected.

Value: 2

CONNECTION_STATE_CONNECTING

static val CONNECTION_STATE_CONNECTING: Int

A connection state indicating the route is in the process of connecting and is not yet ready for use.

Value: 1

CONNECTION_STATE_DISCONNECTED

static val CONNECTION_STATE_DISCONNECTED: Int

The default connection state indicating the route is disconnected.

Value: 0

DEVICE_TYPE_SPEAKER

static val DEVICE_TYPE_SPEAKER: Int

A receiver device type of the route indicating the presentation of the media is happening on a speaker.

Value: 2

See Also

DEVICE_TYPE_TV

static val DEVICE_TYPE_TV: Int

A receiver device type of the route indicating the presentation of the media is happening on a TV.

Value: 1

See Also

PLAYBACK_TYPE_LOCAL

static val PLAYBACK_TYPE_LOCAL: Int

The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. a phone, a tablet) as where it is controlled from.

Value: 0

See Also

PLAYBACK_TYPE_REMOTE

static val PLAYBACK_TYPE_REMOTE: Int

A playback type indicating the presentation of the media is happening on a different device (i.e. the remote device) than where it is controlled from.

Value: 1

See Also

PLAYBACK_VOLUME_FIXED

static val PLAYBACK_VOLUME_FIXED: Int

Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object. An example of fixed playback volume is a remote player, playing over HDMI where the user prefers to control the volume on the HDMI sink, rather than attenuate at the source.

Value: 0

PLAYBACK_VOLUME_VARIABLE

static val PLAYBACK_VOLUME_VARIABLE: Int

Playback information indicating the playback volume is variable and can be controlled from this object.

Value: 1

Public methods

canDisconnect

open fun canDisconnect(): Boolean

Gets whether this route supports disconnecting without interrupting playback.

Return
Boolean True if this route can disconnect without stopping playback, false otherwise.

getConnectionState

open fun getConnectionState(): Int

Gets the connection state of the route.

Return
Int The connection state of this route: CONNECTION_STATE_DISCONNECTED, CONNECTION_STATE_CONNECTING, or CONNECTION_STATE_CONNECTED.

getControlFilters

open fun getControlFilters(): MutableList<IntentFilter!>!

Gets a list of media control intent filters that describe the capabilities of this route and the media control actions that it supports.

Return
MutableList<IntentFilter!>! A list of intent filters that specifies the media control intents that this route supports.

getDescription

@Nullable open fun getDescription(): String?

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

Return
String? The description of the route, or null if none.

getDeviceType

open fun getDeviceType(): Int

Gets the type of the receiver device associated with this route.

Return
Int The type of the receiver device associated with this route: DEVICE_TYPE_TV or DEVICE_TYPE_SPEAKER.

getExtras

@Nullable open fun getExtras(): Bundle?

Gets a collection of ext