to top
Android APIs
public static class

MediaRouter.UserRouteInfo

extends MediaRouter.RouteInfo
java.lang.Object
   ↳ android.media.MediaRouter.RouteInfo
     ↳ android.media.MediaRouter.UserRouteInfo

Class Overview

Information about a route that the application may define and modify. A user route defaults to PLAYBACK_TYPE_REMOTE and PLAYBACK_VOLUME_FIXED.

Summary

[Expand]
Inherited Constants
From class android.media.MediaRouter.RouteInfo
Public Methods

? Examples
RemoteControlClient getRemoteControlClient()
Retrieve the RemoteControlClient associated with this route, if one has been set.

? Examples
void requestSetVolume(int volume)
Request a volume change for this route.

? Examples
void requestUpdateVolume(int direction)
Request an incremental volume update for this route.

? Examples
void setIconDrawable( Drawable icon)
Set an icon that will be used to represent this route.

? Examples
void setIconResource(int resId)
Set an icon that will be used to represent this route.

? Examples
void setName(int resId)
Set the user-visible name of this route.

? Examples
void setName( CharSequence name)
Set the user-visible name of this route.

? Examples
void setPlaybackStream(int stream)
Defines over what stream type the media is presented.

? Examples
void setPlaybackType(int type)
Defines whether playback associated with this route is "local" ( PLAYBACK_TYPE_LOCAL) or "remote" ( PLAYBACK_TYPE_REMOTE).

? Examples
void setRemoteControlClient( RemoteControlClient rcc)
Set the RemoteControlClient responsible for reporting playback info for this user route.

? Examples
void setStatus( CharSequence status)
Set the current user-visible status for this route.

? Examples
void setVolume(int volume)
Defines at what volume the playback associated with this route is performed (for user feedback purposes).

? Examples
void setVolumeCallback( MediaRouter.VolumeCallback vcb)
Set a callback to be notified of volume update requests

? Examples
void setVolumeHandling(int volumeHandling)
Defines whether volume for the playback associated with this route is fixed ( PLAYBACK_VOLUME_FIXED) or can modified ( PLAYBACK_VOLUME_VARIABLE).

? Examples
void setVolumeMax(int volumeMax)
Defines the maximum volume at which the playback associated with this route is performed (for user feedback purposes).
[Expand]
Inherited Methods
From class android.media.MediaRouter.RouteInfo
From class java.lang.Object

Public Methods

public RemoteControlClient getRemoteControlClient ()

Added in API level 16

Retrieve the RemoteControlClient associated with this route, if one has been set.

Returns
  • the RemoteControlClient associated with this route

public void requestSetVolume (int volume)

Added in API level 16

Request a volume change for this route.

Parameters
volume value between 0 and getVolumeMax

public void requestUpdateVolume (int direction)

Added in API level 16

Request an incremental volume update for this route.

Parameters
direction Delta to apply to the current volume

public void setIconDrawable (Drawable icon)

Added in API level 16

Set an icon that will be used to represent this route. The system may use this icon in picker UIs or similar.

Parameters
icon icon drawable to use to represent this route

public void setIconResource (int resId)

Added in API level 16

Set an icon that will be used to represent this route. The system may use this icon in picker UIs or similar.

Parameters
resId Resource ID of an icon drawable to use to represent this route

public void setName (int resId)

Added in API level 16

Set the user-visible name of this route.

Parameters
resId Resource ID of the name to display to the user to describe this route

public void setName (CharSequence name)

Added in API level 16

Set the user-visible name of this route.

Parameters
name Name to display to the user to describe this route

public void setPlaybackStream (int stream)

Added in API level 16

Defines over what stream type the media is presented.

public void setPlaybackType (int type)

Added in API level 16

Defines whether playback associated with this route is "local" (PLAYBACK_TYPE_LOCAL) or "remote" (PLAYBACK_TYPE_REMOTE).

public void setRemoteControlClient (RemoteControlClient rcc)

Added in API level 16

Set the RemoteControlClient responsible for reporting playback info for this user route.

If this route manages remote playback, the data exposed by this RemoteControlClient will be used to reflect and update information such as route volume info in related UIs.

The RemoteControlClient must have been previously registered with registerRemoteControlClient(RemoteControlClient).

Parameters
rcc RemoteControlClient associated with this route

public void setStatus (CharSequence status)

Added in API level 16

Set the current user-visible status for this route.

Parameters
status Status to display to the user to describe what the endpoint of this route is currently doing

public void setVolume (int volume)

Added in API level 16

Defines at what volume the playback associated with this route is performed (for user feedback purposes). This information is only used when the playback is not local.

public void setVolumeCallback (MediaRouter.VolumeCallback vcb)

Added in API level 16

Set a callback to be notified of volume update requests

public void setVolumeHandling (int volumeHandling)

Added in API level 16

Defines whether volume for the playback associated with this route is fixed (PLAYBACK_VOLUME_FIXED) or can modified (PLAYBACK_VOLUME_VARIABLE).

public void setVolumeMax (int volumeMax)

Added in API level 16

Defines the maximum volume at which the playback associated with this route is performed (for user feedback purposes). This information is only used when the playback is not local.

No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.