Back to Exoplayer

MediaSessionConnector.PlaybackPreparer (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.PlaybackPreparer.html

latest5.3 KB
Original Source

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

Interface MediaSessionConnector.PlaybackPreparer


public 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.

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](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.

- 

onPrepareFromSearch

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.

- 

onPrepareFromUri

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.