public abstract class TimelineQueueNavigator extends java.lang.Object implements MediaSessionConnector.QueueNavigator
MediaSessionConnector.QueueNavigator that maps the
windows of a Player's Timeline to the media session queue.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_QUEUE_SIZE |
static long |
MAX_POSITION_FOR_SEEK_TO_PREVIOUS |
protected int |
maxQueueSize |
ACTIONS| Constructor and Description |
|---|
TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession)
Creates an instance for a given
MediaSessionCompat. |
TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession,
int maxQueueSize)
Creates an instance for a given
MediaSessionCompat and maximum queue size. |
| Modifier and Type | Method and Description |
|---|---|
long |
getActiveQueueItemId(com.google.android.exoplayer2.Player player)
Gets the id of the currently active queue item, or
MediaSessionCompat.QueueItem#UNKNOWN_ID if the active item is unknown. |
java.lang.String[] |
getCommands()
Returns the commands the receiver handles, or
null if no commands need to be handled. |
abstract android.support.v4.media.MediaDescriptionCompat |
getMediaDescription(com.google.android.exoplayer2.Player player,
int windowIndex)
Gets the
MediaDescriptionCompat for a given timeline window index. |
long |
getSupportedQueueNavigatorActions(com.google.android.exoplayer2.Player player)
Returns the actions which are supported by the navigator.
|
void |
onCommand(com.google.android.exoplayer2.Player player,
java.lang.String command,
android.os.Bundle extras,
android.os.ResultReceiver cb)
See
MediaSessionCompat.Callback#onCommand(String, Bundle, ResultReceiver). |
void |
onCurrentWindowIndexChanged(com.google.android.exoplayer2.Player player)
Called when the current window index changed.
|
void |
onSkipToNext(com.google.android.exoplayer2.Player player)
See
MediaSessionCompat.Callback#onSkipToNext(). |
void |
onSkipToPrevious(com.google.android.exoplayer2.Player player)
See
MediaSessionCompat.Callback#onSkipToPrevious(). |
void |
onSkipToQueueItem(com.google.android.exoplayer2.Player player,
long id)
See
MediaSessionCompat.Callback#onSkipToQueueItem(long). |
void |
onTimelineChanged(com.google.android.exoplayer2.Player player)
Called when the timeline of the player has changed.
|
public static final long MAX_POSITION_FOR_SEEK_TO_PREVIOUS
public static final int DEFAULT_MAX_QUEUE_SIZE
protected final int maxQueueSize
public TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession)
MediaSessionCompat.
Equivalent to TimelineQueueNavigator(mediaSession, DEFAULT_MAX_QUEUE_SIZE).
mediaSession - The MediaSessionCompat.public TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession,
int maxQueueSize)
MediaSessionCompat and maximum queue size.
If the number of windows in the Player's Timeline exceeds maxQueueSize,
the media session queue will correspond to maxQueueSize windows centered on the one
currently being played.
mediaSession - The MediaSessionCompat.maxQueueSize - The maximum queue size.public abstract android.support.v4.media.MediaDescriptionCompat getMediaDescription(com.google.android.exoplayer2.Player player,
int windowIndex)
MediaDescriptionCompat for a given timeline window index.player - The current player.windowIndex - The timeline window index for which to provide a description.MediaDescriptionCompat.public long getSupportedQueueNavigatorActions(com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatorPlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM, PlaybackStateCompat.ACTION_SKIP_TO_NEXT, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS.getSupportedQueueNavigatorActions in interface MediaSessionConnector.QueueNavigatorplayer - The Player.public final void onTimelineChanged(com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatoronTimelineChanged in interface MediaSessionConnector.QueueNavigatorplayer - The player of which the timeline has changed.public final void onCurrentWindowIndexChanged(com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatoronCurrentWindowIndexChanged in interface MediaSessionConnector.QueueNavigatorplayer - The player of which the current window index of the timeline has changed.public final long getActiveQueueItemId(@Nullable
com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatorMediaSessionCompat.QueueItem#UNKNOWN_ID if the active item is unknown.
To let the connector publish metadata for the active queue item, the queue item with the
returned id must be available in the list of items returned by MediaControllerCompat.getQueue().
getActiveQueueItemId in interface MediaSessionConnector.QueueNavigatorplayer - The player connected to the media session.public void onSkipToPrevious(com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatorMediaSessionCompat.Callback#onSkipToPrevious().onSkipToPrevious in interface MediaSessionConnector.QueueNavigatorpublic void onSkipToQueueItem(com.google.android.exoplayer2.Player player,
long id)
MediaSessionConnector.QueueNavigatorMediaSessionCompat.Callback#onSkipToQueueItem(long).onSkipToQueueItem in interface MediaSessionConnector.QueueNavigatorpublic void onSkipToNext(com.google.android.exoplayer2.Player player)
MediaSessionConnector.QueueNavigatorMediaSessionCompat.Callback#onSkipToNext().onSkipToNext in interface MediaSessionConnector.QueueNavigatorpublic java.lang.String[] getCommands()
MediaSessionConnector.CommandReceivernull if no commands need to be handled.getCommands in interface MediaSessionConnector.CommandReceiverpublic void onCommand(com.google.android.exoplayer2.Player player,
java.lang.String command,
android.os.Bundle extras,
android.os.ResultReceiver cb)
MediaSessionConnector.CommandReceiverMediaSessionCompat.Callback#onCommand(String, Bundle, ResultReceiver).onCommand in interface MediaSessionConnector.CommandReceiver