MediaController Class

Definition

Allows an app to interact with an ongoing media session.

[Android.Runtime.Register("android/media/session/MediaController", DoNotGenerateAcw=true)]
public sealed class MediaController : Java.Lang.Object
[<Android.Runtime.Register("android/media/session/MediaController", DoNotGenerateAcw=true)>]
type MediaController = class
    inherit Object
Inheritance
MediaController
Attributes

Remarks

Allows an app to interact with an ongoing media session. Media buttons and other commands can be sent to the session. A callback may be registered to receive updates from the session, such as metadata and play state changes.

A MediaController can be created through MediaSessionManager if you hold the "android.permission.MEDIA_CONTENT_CONTROL" permission or are an enabled notification listener or by getting a MediaSession.Token directly from the session owner.

MediaController objects are thread-safe.

Java documentation for android.media.session.MediaController.

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

MediaController(Context, MediaSession+Token)

Create a new MediaController from a session's token.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Extras

Get the extras for this session.

Flags

Get the flags for this session.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Metadata

Get the current metadata for this session.

PackageName

Get the session owner's package name.

PeerReference (Inherited from Object)
PlaybackState

Get the current playback state for this session.

Queue

Get the current play queue for this session if one is set.

QueueTitle
QueueTitleFormatted

Get the queue title for this session.

RatingType

Get the rating type supported by the session.

SessionActivity

Get an intent for launching UI associated with this session if one exists.

SessionInfo

Gets the additional session information which was set when the session was created.

SessionToken

Get the token for the session this is connected to.

Tag

Get the session's tag for debugging purposes.

ThresholdClass

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

(Inherited from Object)
ThresholdType

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

(Inherited from Object)

Methods

AdjustVolume(Adjust, AudioFlags)

Adjust the volume of the output this session is playing on.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DispatchMediaButtonEvent(KeyEvent)

Send the specified media button event to the session.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
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)
GetPlaybackInfo()

Get the current playback info for this session.

GetTransportControls()

Get a TransportControls instance to send transport actions to the associated session.

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)
RegisterCallback(MediaController+Callback)

Registers a callback to receive updates from the Session.

RegisterCallback(MediaController+Callback, Handler)

Registers a callback to receive updates from the Session.

SendCommand(String, Bundle, ResultReceiver)

Sends a generic command to the session.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetVolumeTo(Int32, AudioFlags)

Set the volume of the output this session is playing on.

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

Returns a string representation of the object.

(Inherited from Object)
UnregisterCallback(MediaController+Callback)

Unregisters the specified callback.

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)

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, 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)

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