docs/doc/reference/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.PlaybackPreparer.html
Package com.google.android.exoplayer2.ext.mediasession
MediaSessionConnector.CommandReceiverEnclosing class:MediaSessionConnectorpublic static interfaceMediaSessionConnector.PlaybackPreparerextends[MediaSessionConnector.CommandReceiver](MediaSessionConnector.CommandReceiver.html "interface in com.google.android.exoplayer2.ext.mediasession")
Interface to which playback preparation and play actions are delegated.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static long | ACTIONS | |
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).
|
-
onCommand
-
static final long ACTIONS
See Also:Constant Field Values
-
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.
-
void onPrepare(boolean playWhenReady)
See MediaSessionCompat.Callback.onPrepare().
Parameters:playWhenReady - Whether playback should be started after preparation.
-
void onPrepareFromMediaId([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mediaId,
boolean playWhenReady,
@Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")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.
-
void onPrepareFromSearch([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")query,
boolean playWhenReady,
@Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")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.
-
void onPrepareFromUri([Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri,
boolean playWhenReady,
@Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")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.