See Also: MediaSession Members
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.