Bagikan melalui


RemoteControlClient Class

Definition

Caution

This class is obsoleted in this android platform

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

[Android.Runtime.Register("android/media/RemoteControlClient", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public class RemoteControlClient : Java.Lang.Object
[<Android.Runtime.Register("android/media/RemoteControlClient", DoNotGenerateAcw=true)>]
[<System.Obsolete("This class is obsoleted in this android platform")>]
type RemoteControlClient = class
    inherit Object
Inheritance
RemoteControlClient
Attributes

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:

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, PendingIntent.FLAG_MUTABLE_UNAUDITED);
            // create and register the remote control client
            RemoteControlClient myRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
            myAudioManager.registerRemoteControlClient(myRemoteControlClient);

This member is deprecated. Use MediaSession instead.

Java documentation for android.media.RemoteControlClient.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

RemoteControlClient(IntPtr, JniHandleOwnership)

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

RemoteControlClient(PendingIntent, Looper)
Obsolete.

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

RemoteControlClient(PendingIntent)
Obsolete.

Class constructor.

Fields

FlagKeyMediaFastForward
Obsolete.

Flag indicating a RemoteControlClient makes use of the "fast forward" media key.

FlagKeyMediaNext
Obsolete.

Flag indicating a RemoteControlClient makes use of the "next" media key.

FlagKeyMediaPause
Obsolete.

Flag indicating a RemoteControlClient makes use of the "pause" media key.

FlagKeyMediaPlay
Obsolete.

Flag indicating a RemoteControlClient makes use of the "play" media key.

FlagKeyMediaPlayPause
Obsolete.

Flag indicating a RemoteControlClient makes use of the "play/pause" media key.

FlagKeyMediaPositionUpdate
Obsolete.

Flag indicating a RemoteControlClient can receive changes in the media playback position through the OnPlaybackPositionUpdateListener interface.

FlagKeyMediaPrevious
Obsolete.

Flag indicating a RemoteControlClient makes use of the "previous" media key.

FlagKeyMediaRating
Obsolete.

Flag indicating a RemoteControlClient supports ratings.

FlagKeyMediaRewind
Obsolete.

Flag indicating a RemoteControlClient makes use of the "rewind" media key.

FlagKeyMediaStop
Obsolete.

Flag indicating a RemoteControlClient makes use of the "stop" media key.

PlaystateBuffering
Obsolete.

Playback state of a RemoteControlClient which is buffering data to play before it can start or resume playback.

PlaystateError
Obsolete.

Playback state of a RemoteControlClient which cannot perform any playback related operation because of an internal error.

PlaystateFastForwarding
Obsolete.

Playback state of a RemoteControlClient which is fast forwarding in the media it is currently playing.

PlaystatePaused
Obsolete.

Playback state of a RemoteControlClient which is paused.

PlaystatePlaying
Obsolete.

Playback state of a RemoteControlClient which is playing media.

PlaystateRewinding
Obsolete.

Playback state of a RemoteControlClient which is fast rewinding in the media it is currently playing.

PlaystateSkippingBackwards
Obsolete.

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.

PlaystateSkippingForwards
Obsolete.

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.

PlaystateStopped
Obsolete.

Playback state of a RemoteControlClient which is stopped.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
GetPlaybackPosition
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MediaSession
Obsolete.

Get a MediaSession associated with this RCC.

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EditMetadata(Boolean)
Obsolete.

Creates a MetadataEditor.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetMetadataUpdateListener(RemoteControlClient+IOnMetadataUpdateListener)
Obsolete.

Sets the listener to be called whenever the metadata is updated.

SetOnGetPlaybackPositionListener(RemoteControlClient+IOnGetPlaybackPositionListener)
Obsolete.

Sets the listener to be called whenever the media current playback position is needed.

SetPlaybackPositionUpdateListener(RemoteControlClient+IOnPlaybackPositionUpdateListener)
Obsolete.

Sets the listener to be called whenever the media playback position is requested to be updated.

SetPlaybackState(RemoteControlPlayState, Int64, Single)
Obsolete.

Sets the current playback state and the matching media position for the current playback speed.

SetPlaybackState(RemoteControlPlayState)
Obsolete.

Sets the current playback state.

SetTransportControlFlags(RemoteControlFlags)
Obsolete.

Sets the flags for the media transport control buttons that this client supports.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Events

MetadataUpdate
PlaybackPositionUpdate

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to