Android.Media.Session.MediaSession Class
Allows interaction with media controllers, volume keys, media buttons, and transport controls.

See Also: MediaSession Members

Syntax

[Android.Runtime.Register("android/media/session/MediaSession", DoNotGenerateAcw=true)]
public sealed class MediaSession : Java.Lang.Object

Remarks

Allows interaction with media controllers, volume keys, media buttons, and transport controls.

A MediaSession should be created when an app wants to publish media playback information or handle media keys. In general an app only needs one session for all playback, though multiple sessions can be created to provide finer grain controls of media.

Once a session is created the owner of the session may pass its MediaSession.SessionToken to other processes to allow them to create a Android.Media.Session.MediaController to interact with the session.

To receive commands, media keys, and other events a NoType:android/media/session/MediaSession$Callback;Href=../../../../reference/android/media/session/MediaSession.Callback.html must be set with MediaSession.SetCallback(.Callback) and MediaSession.Active must be called.

When an app is finished performing playback it must call MediaSession.Release to clean up the session and notify any controllers.

MediaSession objects are thread safe.

[Android Documentation]

Requirements

Namespace: Android.Media.Session
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0