public static class MediaRouter.RouteInfo extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PLAYBACK_TYPE_LOCAL
The default playback type, "local", indicating the presentation of the media is happening
on the same device (e.g.
|
static int |
PLAYBACK_TYPE_REMOTE
A playback type indicating the presentation of the media is happening on
a different device (i.e.
|
static int |
PLAYBACK_VOLUME_FIXED
Playback information indicating the playback volume is fixed, i.e.
|
static int |
PLAYBACK_VOLUME_VARIABLE
Playback information indicating the playback volume is variable and can be controlled
from this object.
|
static int |
STATUS_AVAILABLE |
static int |
STATUS_CONNECTING |
static int |
STATUS_NONE |
static int |
STATUS_NOT_AVAILABLE |
static int |
STATUS_SCANNING |
Modifier and Type | Method and Description |
---|---|
MediaRouter.RouteCategory |
getCategory() |
MediaRouter.RouteGroup |
getGroup() |
Drawable |
getIconDrawable()
Get the icon representing this route.
|
CharSequence |
getName() |
CharSequence |
getName(Context context)
Return the properly localized/resource selected name of this route.
|
int |
getPlaybackStream() |
int |
getPlaybackType() |
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. |
CharSequence |
getStatus() |
int |
getStatusCode() |
int |
getSupportedTypes() |
Object |
getTag() |
int |
getVolume()
Return the current volume for this route.
|
int |
getVolumeHandling() |
int |
getVolumeMax() |
boolean |
isEnabled() |
void |
requestSetVolume(int volume)
Request a volume change for this route.
|
void |
requestUpdateVolume(int direction)
Request an incremental volume update for this route.
|
void |
setTag(Object tag)
Set an application-specific tag object for this route.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
public static final int STATUS_NONE
public static final int STATUS_SCANNING
public static final int STATUS_CONNECTING
public static final int STATUS_AVAILABLE
public static final int STATUS_NOT_AVAILABLE
public static final int PLAYBACK_TYPE_LOCAL
#setPlaybackType(int)
,
Constant Field Valuespublic static final int PLAYBACK_TYPE_REMOTE
#setPlaybackType(int)
,
Constant Field Valuespublic static final int PLAYBACK_VOLUME_FIXED
#setVolumeHandling(int)
,
Constant Field Valuespublic static final int PLAYBACK_VOLUME_VARIABLE
public CharSequence getName()
public CharSequence getName(Context context)
context
- Context used to resolve the correct configuration to loadpublic CharSequence getStatus()
public int getStatusCode()
public int getSupportedTypes()
public MediaRouter.RouteGroup getGroup()
public MediaRouter.RouteCategory getCategory()
public Drawable getIconDrawable()
public void setTag(Object tag)
Note that the lifespan of a route may be well past the lifespan of an Activity or other Context; take care that objects you store here will not keep more data in memory alive than you intend.
tag
- Arbitrary, app-specific data for this route to hold for later usepublic Object getTag()
setTag(Object)
public int getPlaybackType()
MediaRouter.UserRouteInfo.setPlaybackType(int)
public int getPlaybackStream()
MediaRouter.UserRouteInfo.setPlaybackStream(int)
public int getVolume()
MediaRouter.UserRouteInfo.setVolume(int)
public void requestSetVolume(int volume)
volume
- value between 0 and getVolumeMaxpublic void requestUpdateVolume(int direction)
direction
- Delta to apply to the current volumepublic int getVolumeMax()
MediaRouter.UserRouteInfo.setVolumeMax(int)
public int getVolumeHandling()
MediaRouter.UserRouteInfo.setVolumeHandling(int)
public Display getPresentationDisplay()
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 MediaRouter.Callback.onRoutePresentationDisplayChanged(android.media.MediaRouter, android.media.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.
MediaRouter.ROUTE_TYPE_LIVE_VIDEO
,
Presentation
public boolean isEnabled()
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.