| java.lang.Object | |
| ↳ | android.media.session.MediaSession.Callback | 
Receives media buttons, transport controls, and commands from controllers
 and the system. A callback may be set using setCallback(MediaSession.Callback).
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 
          Called when a controller has sent a command to this session.
          
    
         | |||||||||||
| 
          Called when a  MediaControllerwants aPlaybackState.CustomActionto be
 performed. | |||||||||||
| 
          Override to handle requests to fast forward.
          
    
         | |||||||||||
| 
          Called when a media button is pressed and this session has the
 highest priority or a controller sends a media button event to the
 session.
          
    
         | |||||||||||
| 
          Override to handle requests to pause playback.
          
    
         | |||||||||||
| 
          Override to handle requests to begin playback.
          
    
         | |||||||||||
| 
          Override to handle requests to play a specific mediaId that was
 provided by your app's  MediaBrowserService. | |||||||||||
| 
          Override to handle requests to begin playback from a search query.
          
    
         | |||||||||||
| 
          Override to handle requests to rewind.
          
    
         | |||||||||||
| 
          Override to handle requests to seek to a specific position in ms.
          
    
         | |||||||||||
| 
          Override to handle the item being rated.
          
    
         | |||||||||||
| 
          Override to handle requests to skip to the next media item.
          
    
         | |||||||||||
| 
          Override to handle requests to skip to the previous media item.
          
    
         | |||||||||||
| 
          Override to handle requests to play an item with a given id from the
 play queue.
          
    
         | |||||||||||
| 
          Override to handle requests to stop playback.
          
    
         | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.lang.Object | |||||||||||
Called when a controller has sent a command to this session. The owner of the session may handle custom commands but is not required to.
| command | The command name. | 
|---|---|
| args | Optional parameters for the command, may be null. | 
| cb | A result receiver to which a result may be sent by the command, may be null. | 
Called when a MediaController wants a PlaybackState.CustomAction to be
 performed.
| action | The action that was originally sent in the PlaybackState.CustomAction. | 
|---|---|
| extras | Optional extras specified by the MediaController. | 
Called when a media button is pressed and this session has the highest priority or a controller sends a media button event to the session. The default behavior will call the relevant method if the action for it was set.
 The intent will be of type ACTION_MEDIA_BUTTON with a
 KeyEvent in EXTRA_KEY_EVENT
| mediaButtonIntent | an intent containing the KeyEvent as an extra | 
|---|
Override to handle requests to play a specific mediaId that was
 provided by your app's MediaBrowserService.
Override to handle requests to begin playback from a search query. An empty query indicates that the app may play any music. The implementation should attempt to make a smart choice about what to play.
Override to handle requests to seek to a specific position in ms.
| pos | New position to move to, in milliseconds. | 
|---|
Override to handle the item being rated.
Override to handle requests to skip to the next media item.
Override to handle requests to skip to the previous media item.
Override to handle requests to play an item with a given id from the play queue.