belongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1
MediaRouter.RouteInfo
public
static
class
MediaRouter.RouteInfo
extends Object
java.lang.Object | |
↳ | android.support.v7.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 | |
---|---|
int |
CONNECTION_STATE_CONNECTED
A connection state indicating the route is connected. |
int |
CONNECTION_STATE_CONNECTING
A connection state indicating the route is in the process of connecting and is not yet ready for use. |
int |
CONNECTION_STATE_DISCONNECTED
The default connection state indicating the route is disconnected. |
int |
DEVICE_TYPE_SPEAKER
A receiver device type of the route indicating the presentation of the media is happening on a speaker. |
int |
DEVICE_TYPE_TV
A receiver device type of the route indicating the presentation of the media is happening on a TV. |
int |
PLAYBACK_TYPE_LOCAL
The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. |
int |
PLAYBACK_TYPE_REMOTE
A playback type indicating the presentation of the media is happening on a different device (i.e. |
int |
PLAYBACK_VOLUME_FIXED
Playback information indicating the playback volume is fixed, i.e. |
int |
PLAYBACK_VOLUME_VARIABLE
Playback information indicating the playback volume is variable and can be controlled from this object. |
Public methods | |
---|---|
boolean
|
canDisconnect()
Gets whether this route supports disconnecting without interrupting playback. |
int
|
getConnectionState()
Gets the connection state of the route. |
List<IntentFilter>
|
getControlFilters()
Gets a list of |
String
|
getDescription()
Gets the user-visible description of the route. |
int
|
getDeviceType()
Gets the type of the receiver device associated with this route. |
Bundle
|
getExtras()
Gets a collection of extra properties about this route that were supplied by its media route provider, or null if none. |
Uri
|
getIconUri()
Gets the URI of the icon representing this route. |
String
|
getId()
Gets the unique id of the route. |
String
|
getName()
Gets the user-visible name of the route. |
int
|
getPlaybackStream()
Gets the audio stream over which the playback associated with this route is performed. |
int
|
getPlaybackType()
Gets the type of playback associated with this route. |
Display
|
getPresentationDisplay()
Gets the |
MediaRouter.ProviderInfo
|
getProvider()
Gets information about the provider of this media route. |
IntentSender
|
getSettingsIntent()
Gets an intent sender for launching a settings activity for this route. |
int
|
getVolume()
Gets the current volume for this route. |
int
|
getVolumeHandling()
Gets information about how volume is handled on the route. |
int
|
getVolumeMax()
Gets the maximum volume at which the playback associated with this route is performed. |
boolean
|
isBluetooth()
Returns true if this route is a bluetooth route. |
boolean
|
isConnecting()
Returns true if the route is in the process of connecting and is not yet ready for use. |
boolean
|
isDefault()
Returns true if this route is the default route. |
boolean
|
isDeviceSpeaker()
Returns true if this route is the default route and the device speaker. |
boolean
|
isEnabled()
Returns true if this route is enabled and may be selected. |
boolean
|
isSelected()
Returns true if this route is currently selected. |
boolean
|
matchesSelector(MediaRouteSelector selector)
Returns true if the route supports at least one of the capabilities described by a media route selector. |
void
|
requestSetVolume(int volume)
Requests a volume change for this route asynchronously. |
void
|
requestUpdateVolume(int delta)
Requests an incremental volume update for this route asynchronously. |
void
|
select()
Selects this media route. |
void
|
sendControlRequest(Intent intent, MediaRouter.ControlRequestCallback callback)
Sends a |
boolean
|
supportsControlAction(String category, String action)
Returns true if the route supports the specified
|
boolean
|
supportsControlCategory(String category)
Returns true if the route supports the specified
|
boolean
|
supportsControlRequest(Intent intent)
Returns true if the route supports the specified
|
String
|
toString()
|
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Constants
CONNECTION_STATE_CONNECTED
int CONNECTION_STATE_CONNECTED
A connection state indicating the route is connected.
See also:
Constant Value: 2 (0x00000002)
CONNECTION_STATE_CONNECTING
int CONNECTION_STATE_CONNECTING
A connection state indicating the route is in the process of connecting and is not yet ready for use.
See also:
Constant Value: 1 (0x00000001)
CONNECTION_STATE_DISCONNECTED
int CONNECTION_STATE_DISCONNECTED
The default connection state indicating the route is disconnected.
See also:
Constant Value: 0 (0x00000000)
DEVICE_TYPE_SPEAKER
int DEVICE_TYPE_SPEAKER
A receiver device type of the route indicating the presentation of the media is happening on a speaker.
See also:
Constant Value: 2 (0x00000002)
DEVICE_TYPE_TV
int DEVICE_TYPE_TV
A receiver device type of the route indicating the presentation of the media is happening on a TV.
See also:
Constant Value: 1 (0x00000001)
PLAYBACK_TYPE_LOCAL
int PLAYBACK_TYPE_LOCAL
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.
See also:
Constant Value: 0 (0x00000000)
PLAYBACK_TYPE_REMOTE
int PLAYBACK_TYPE_REMOTE
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.
See also:
Constant Value: 1 (0x00000001)
PLAYBACK_VOLUME_FIXED
int PLAYBACK_VOLUME_FIXED
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.
See also:
Constant Value: 0 (0x00000000)
PLAYBACK_VOLUME_VARIABLE
int PLAYBACK_VOLUME_VARIABLE
Playback information indicating the playback volume is variable and can be controlled from this object.
See also:
Constant Value: 1 (0x00000001)
Public methods
canDisconnect
boolean canDisconnect ()
Gets whether this route supports disconnecting without interrupting playback.
Returns | |
---|---|
boolean |
True if this route can disconnect without stopping playback, false otherwise. |
getConnectionState
int getConnectionState ()
Gets the connection state of the route.
Returns | |
---|---|
int |
The connection state of this route: CONNECTION_STATE_DISCONNECTED ,
CONNECTION_STATE_CONNECTING , or CONNECTION_STATE_CONNECTED .
|
getControlFilters
List<IntentFilter> getControlFilters ()
Gets a list of media control intent
filters that
describe the capabilities of this route and the media control actions that
it supports.
Returns | |
---|---|
List<IntentFilter> |
A list of intent filters that specifies the media control intents that this route supports. |
getDescription
String getDescription ()
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.
Returns | |
---|---|
String |
The description of the route, or null if none. |
getDeviceType
int getDeviceType ()
Gets the type of the receiver device associated with this route.
Returns | |
---|---|
int |
The type of the receiver device associated with this route:
DEVICE_TYPE_TV or DEVICE_TYPE_SPEAKER .
|
getExtras
Bundle getExtras ()
Gets a collection of extra properties about this route that were supplied by its media route provider, or null if none.
Returns | |
---|---|
Bundle |
getIconUri
Uri getIconUri ()
Gets the URI of the icon representing this route.
This icon will be used in picker UIs if available.
Returns | |
---|---|
Uri |
The URI of the icon representing this route, or null if none. |
getId
String getId ()
Gets the unique id of the route.
The route unique id functions as a stable identifier by which the route is known. For example, an application can use this id as a token to remember the selected route across restarts or to communicate its identity to a service.
Returns | |
---|---|
String |
The unique id of the route, never null. |
getName
String getName ()
Gets 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.
Returns | |
---|---|
String |
The user-visible name of a media route. This is the string presented to users who may select this as the active route. |
getPlaybackStream
int getPlaybackStream ()
Gets the audio stream over which the playback associated with this route is performed.
Returns | |
---|---|
int |
The stream over which the playback associated with this route is performed. |
getPlaybackType
int getPlaybackType ()
Gets the type of playback associated with this route.
Returns | |
---|---|
int |
The type of playback associated with this route: PLAYBACK_TYPE_LOCAL
or PLAYBACK_TYPE_REMOTE .
|
getPresentationDisplay
Display getPresentationDisplay ()
Gets the Display
that should be used by the application to show
a Presentation
on an external display when this route is selected.
Depending on the route, this may only be valid if the route is currently
selected.
The preferred presentation display may change independently of the route being selected or unselected. For example, the presentation display of the default system route may change when an external HDMI display is connected or disconnected even though the route itself has not changed.
This method may return null if there is no external display associated with the route or if the display is not ready to show UI yet.
The application should listen for changes to the presentation display
using the onRoutePresentationDisplayChanged(MediaRouter, MediaRouter.RouteInfo)
callback and
show or dismiss its Presentation
accordingly when the display
becomes available or is removed.
This method only makes sense for
live video
routes.
Returns | |
---|---|
Display |
The preferred presentation display to use when this route is selected or null if none. |
See also:
getProvider
MediaRouter.ProviderInfo getProvider ()
Gets information about the provider of this media route.
Returns | |
---|---|
MediaRouter.ProviderInfo |
getSettingsIntent
IntentSender getSettingsIntent ()
Gets an intent sender for launching a settings activity for this route.
Returns | |
---|---|
IntentSender |
getVolume
int getVolume ()
Gets the current volume for this route. Depending on the route, this may only be valid if the route is currently selected.
Returns | |
---|---|
int |
The volume at which the playback associated with this route is performed. |
getVolumeHandling
int getVolumeHandling ()
Gets information about how volume is handled on the route.
Returns | |
---|---|
int |
How volume is handled on the route: PLAYBACK_VOLUME_FIXED
or PLAYBACK_VOLUME_VARIABLE .
|
getVolumeMax
int getVolumeMax ()
Gets the maximum volume at which the playback associated with this route is performed.
Returns | |
---|---|
int |
The maximum volume at which the playback associated with this route is performed. |
isBluetooth
boolean isBluetooth ()
Returns true if this route is a bluetooth route.
Returns | |
---|---|
boolean |
True if this route is a bluetooth route. |
See also:
isConnecting
boolean isConnecting ()
Returns true if the route is in the process of connecting and is not yet ready for use.
Returns | |
---|---|
boolean |
True if this route is in the process of connecting. |
isDefault
boolean isDefault ()
Returns true if this route is the default route.
Returns | |
---|---|
boolean |
True if this route is the default route. |
See also:
isDeviceSpeaker
boolean isDeviceSpeaker ()
Returns true if this route is the default route and the device speaker.
Returns | |
---|---|
boolean |
True if this route is the default route and the device speaker. |
isEnabled
boolean isEnabled ()
Returns true if this route is enabled and may be selected.
Returns | |
---|---|
boolean |
True if this route is enabled. |
isSelected
boolean isSelected ()
Returns true if this route is currently selected.
Returns | |
---|---|
boolean |
True if this route is currently selected. |
See also:
matchesSelector
boolean matchesSelector (MediaRouteSelector selector)
Returns true if the route supports at least one of the capabilities described by a media route selector.
Parameters | |
---|---|
selector |
MediaRouteSelector : The selector that specifies the capabilities to check. |
Returns | |
---|---|
boolean |
True if the route supports at least one of the capabilities described in the media route selector. |
requestSetVolume
void requestSetVolume (int volume)
Requests a volume change for this route asynchronously.
This function may only be called on a selected route. It will have no effect if the route is currently unselected.
Parameters | |
---|---|
volume |
int : The new volume value between 0 and getVolumeMax() .
|
requestUpdateVolume
void requestUpdateVolume (int delta)
Requests an incremental volume update for this route asynchronously.
This function may only be called on a selected route. It will have no effect if the route is currently unselected.
Parameters | |
---|---|
delta |
int : The delta to add to the current volume.
|
sendControlRequest
void sendControlRequest (Intent intent, MediaRouter.ControlRequestCallback callback)
Sends a media control
request to be performed
asynchronously by the route's destination.
Media control requests are used to request the route to perform actions such as starting remote playback of a media item.
This function may only be called on a selected route. Control requests sent to unselected routes will fail.
Parameters | |
---|---|
intent |
Intent : A media control intent . |
callback |
MediaRouter.ControlRequestCallback : A MediaRouter.ControlRequestCallback to invoke with the result
of the request, or null if no result is required. |
See also:
supportsControlAction
boolean supportsControlAction (String category, String action)
Returns true if the route supports the specified
media control
category and action.
Media control actions describe specific requests that an application can ask a route to perform.
Parameters | |
---|---|
category |
String : A media control category
such as CATEGORY_LIVE_AUDIO ,
CATEGORY_LIVE_VIDEO ,
CATEGORY_REMOTE_PLAYBACK , or a provider-defined
media control category. |
action |
String : A media control action
such as ACTION_PLAY . |
Returns | |
---|---|
boolean |
True if the route supports the specified intent action. |
See also:
supportsControlCategory
boolean supportsControlCategory (String category)
Returns true if the route supports the specified
media control
category.
Media control categories describe the capabilities of this route such as whether it supports live audio streaming or remote playback.
Parameters | |
---|---|
category |
String : A media control category
such as CATEGORY_LIVE_AUDIO ,
CATEGORY_LIVE_VIDEO ,
CATEGORY_REMOTE_PLAYBACK , or a provider-defined
media control category. |
Returns | |
---|---|
boolean |
True if the route supports the specified intent category. |
See also:
supportsControlRequest
boolean supportsControlRequest (Intent intent)
Returns true if the route supports the specified
media control
request.
Media control requests are used to request the route to perform actions such as starting remote playback of a media item.
Parameters | |
---|---|
intent |
Intent : A media control intent . |
Returns | |
---|---|
boolean |
True if the route can handle the specified intent. |
See also:
toString
String toString ()
Returns | |
---|---|
String |
Interfaces
Classes
- MediaControlIntent
- MediaItemMetadata
- MediaItemStatus
- MediaItemStatus.Builder
- MediaRouteDescriptor
- MediaRouteDescriptor.Builder
- MediaRouteDiscoveryRequest
- MediaRouteProvider
- MediaRouteProvider.Callback
- MediaRouteProvider.ProviderMetadata
- MediaRouteProvider.RouteController
- MediaRouteProviderDescriptor
- MediaRouteProviderDescriptor.Builder
- MediaRouteProviderService
- MediaRouter
- MediaRouter.Callback
- MediaRouter.ControlRequestCallback
- MediaRouter.ProviderInfo
- MediaRouter.RouteInfo
- MediaRouteSelector
- MediaRouteSelector.Builder
- MediaSessionStatus
- MediaSessionStatus.Builder
- RemotePlaybackClient
- RemotePlaybackClient.ActionCallback
- RemotePlaybackClient.ItemActionCallback
- RemotePlaybackClient.SessionActionCallback
- RemotePlaybackClient.StatusCallback