Android Guides | Samples

Android.Media.RemoteControlClient Class

RemoteControlClient enables exposing information meant to be consumed by remote controls capable of displaying metadata, artwork and media transport control buttons.

See Also: RemoteControlClient Members

Syntax

[Android.Runtime.Register("android/media/RemoteControlClient", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public class RemoteControlClient : Object

Remarks

RemoteControlClient enables exposing information meant to be consumed by remote controls capable of displaying metadata, artwork and media transport control buttons.

A remote control client object is associated with a media button event receiver. This event receiver must have been previously registered with AudioManager.RegisterMediaButtonEventReceiver(ComponentName) before the RemoteControlClient can be registered through AudioManager.RegisterRemoteControlClient(RemoteControlClient).

Here is an example of creating a RemoteControlClient instance after registering a media button event receiver:

java Example

ComponentName myEventReceiver = new ComponentName(getPackageName(), MyRemoteControlEventReceiver.class.getName());
 AudioManager myAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
 myAudioManager.registerMediaButtonEventReceiver(myEventReceiver);
 // build the PendingIntent for the remote control client
 Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
 mediaButtonIntent.setComponent(myEventReceiver);
 PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0);
 // create and register the remote control client
 RemoteControlClient myRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
 myAudioManager.registerRemoteControlClient(myRemoteControlClient);

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14

The members of Android.Media.RemoteControlClient are listed below.

See Also: Inherited members from Java.Lang.Object

Public Constructors

Class constructor.
Class constructor for a remote control client whose internal event handling happens on a user-provided Looper.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
FlagKeyMediaFastForwardRemoteControlFlags (64). Flag indicating a RemoteControlClient makes use of the "fast forward" media key.
const
FlagKeyMediaNextRemoteControlFlags (128). Flag indicating a RemoteControlClient makes use of the "next" media key.
const
FlagKeyMediaPauseRemoteControlFlags (16). Flag indicating a RemoteControlClient makes use of the "pause" media key.
const
FlagKeyMediaPlayRemoteControlFlags (4). Flag indicating a RemoteControlClient makes use of the "play" media key.
const
FlagKeyMediaPlayPauseRemoteControlFlags (8). Flag indicating a RemoteControlClient makes use of the "play/pause" media key.
const
FlagKeyMediaPositionUpdateRemoteControlFlags (256). Flag indicating a RemoteControlClient can receive changes in the media playback position through the NoType:android/media/RemoteControlClient$OnPlaybackPositionUpdateListener;Href=../../../reference/android/media/RemoteControlClient.OnPlaybackPositionUpdateListener.html interface.
const
FlagKeyMediaPreviousRemoteControlFlags (1). Flag indicating a RemoteControlClient makes use of the "previous" media key.
const
FlagKeyMediaRatingRemoteControlFlags (512). Flag indicating a RemoteControlClient supports ratings.
const
FlagKeyMediaRewindRemoteControlFlags (2). Flag indicating a RemoteControlClient makes use of the "rewind" media key.
const
FlagKeyMediaStopRemoteControlFlags (32). Flag indicating a RemoteControlClient makes use of the "stop" media key.
const
PlaystateBufferingRemoteControlPlayState (8). Playback state of a RemoteControlClient which is buffering data to play before it can start or resume playback.
const
PlaystateErrorRemoteControlPlayState (9). Playback state of a RemoteControlClient which cannot perform any playback related operation because of an internal error.
const
PlaystateFastForwardingRemoteControlPlayState (4). Playback state of a RemoteControlClient which is fast forwarding in the media it is currently playing.
const
PlaystatePausedRemoteControlPlayState (2). Playback state of a RemoteControlClient which is paused.
const
PlaystatePlayingRemoteControlPlayState (3). Playback state of a RemoteControlClient which is playing media.
const
PlaystateRewindingRemoteControlPlayState (5). Playback state of a RemoteControlClient which is fast rewinding in the media it is currently playing.
const
PlaystateSkippingBackwardsRemoteControlPlayState (7). Playback state of a RemoteControlClient which is skipping back to the previous logical chapter (such as a song in a playlist) in the media it is currently playing.
const
PlaystateSkippingForwardsRemoteControlPlayState (6). Playback state of a RemoteControlClient which is skipping to the next logical chapter (such as a song in a playlist) in the media it is currently playing.
const
PlaystateStoppedRemoteControlPlayState (1). Playback state of a RemoteControlClient which is stopped.

Public Properties

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

EditMetadata(bool) : MetadataEditor
Creates a NoType:android/media/RemoteControlClient$MetadataEditor;Href=../../../reference/android/media/RemoteControlClient.MetadataEditor.html.
SetMetadataUpdateListener(IOnMetadataUpdateListener)
Sets the listener to be called whenever the metadata is updated.
SetOnGetPlaybackPositionListener(IOnGetPlaybackPositionListener)
Sets the listener to be called whenever the media current playback position is needed.
SetPlaybackPositionUpdateListener(IOnPlaybackPositionUpdateListener)
Sets the listener to be called whenever the media playback position is requested to be updated.
SetPlaybackState(RemoteControlPlayState)
Sets the current playback state.
SetPlaybackState(RemoteControlPlayState, long, float)
Sets the current playback state and the matching media position for the current playback speed.
SetTransportControlFlags(RemoteControlFlags)
Sets the flags for the media transport control buttons that this client supports.

Public Events