Package com.google.android.exoplayer2.ext.mediasession

## Interface MediaSessionConnector.PlaybackPreparer

- All Superinterfaces:
    `MediaSessionConnector.CommandReceiver`
  Enclosing class:
    MediaSessionConnector

      public static interface MediaSessionConnector.PlaybackPreparer
      extends MediaSessionConnector.CommandReceiver

  Interface to which playback preparation and play actions are delegated.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static long` | `ACTIONS` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `getSupportedPrepareActions()` | Returns the actions which are supported by the preparer.
    `void` | `onPrepare​(boolean playWhenReady)` | See `MediaSessionCompat.Callback.onPrepare()`.
    `void` | `onPrepareFromMediaId​(String mediaId, boolean playWhenReady, Bundle extras)` | See `MediaSessionCompat.Callback.onPrepareFromMediaId(String, Bundle)`.
    `void` | `onPrepareFromSearch​(String query, boolean playWhenReady, Bundle extras)` | See `MediaSessionCompat.Callback.onPrepareFromSearch(String, Bundle)`.
    `void` | `onPrepareFromUri​(Uri uri, boolean playWhenReady, Bundle extras)` | See `MediaSessionCompat.Callback.onPrepareFromUri(Uri, Bundle)`.

    - ### Methods inherited from interface com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector.CommandReceiver

      `onCommand`

- - ### Field Detail

    - #### ACTIONS

          static final long ACTIONS

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getSupportedPrepareActions

          long getSupportedPrepareActions()

      Returns the actions which are supported by the preparer. The supported actions must be a bitmask combined out of `PlaybackStateCompat.ACTION_PREPARE`, `PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID`, `PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH`, `PlaybackStateCompat.ACTION_PREPARE_FROM_URI`, `PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID`, `PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH` and `PlaybackStateCompat.ACTION_PLAY_FROM_URI`.
      Returns:
        The bitmask of the supported media actions.

    - #### onPrepare

          void onPrepare​(boolean playWhenReady)

      See `MediaSessionCompat.Callback.onPrepare()`.
      Parameters:
        `playWhenReady` - Whether playback should be started after preparation.

    - #### onPrepareFromMediaId

          void onPrepareFromMediaId​(String mediaId,
                                    boolean playWhenReady,
                                    @Nullable
                                    Bundle extras)

      See `MediaSessionCompat.Callback.onPrepareFromMediaId(String, Bundle)`.
      Parameters:
        `mediaId` - The media id of the media item to be prepared.
        `playWhenReady` - Whether playback should be started after preparation.
        `extras` - A `Bundle` of extras passed by the media controller, may be null.

    - #### onPrepareFromSearch

          void onPrepareFromSearch​(String query,
                                   boolean playWhenReady,
                                   @Nullable
                                   Bundle extras)

      See `MediaSessionCompat.Callback.onPrepareFromSearch(String, Bundle)`.
      Parameters:
        `query` - The search query.
        `playWhenReady` - Whether playback should be started after preparation.
        `extras` - A `Bundle` of extras passed by the media controller, may be null.

    - #### onPrepareFromUri

          void onPrepareFromUri​(Uri uri,
                                boolean playWhenReady,
                                @Nullable
                                Bundle extras)

      See `MediaSessionCompat.Callback.onPrepareFromUri(Uri, Bundle)`.
      Parameters:
        `uri` - The `Uri` of the media item to be prepared.
        `playWhenReady` - Whether playback should be started after preparation.
        `extras` - A `Bundle` of extras passed by the media controller, may be null.