Back to Exoplayer

MediaSessionConnector.QueueNavigator (ExoPlayer library)

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

latest4.9 KB
Original Source

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

Interface MediaSessionConnector.QueueNavigator

  • All Superinterfaces:MediaSessionConnector.CommandReceiverAll Known Implementing Classes:TimelineQueueNavigatorEnclosing class:MediaSessionConnector

public static interfaceMediaSessionConnector.QueueNavigatorextends[MediaSessionConnector.CommandReceiver](MediaSessionConnector.CommandReceiver.html "interface in com.google.android.exoplayer2.ext.mediasession")

Handles queue navigation actions, and updates the media session queue by calling MediaSessionCompat.setQueue().

Field Summary

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

Method Summary

All Methods Instance Methods Abstract Methods Default Methods | Modifier and Type | Method | Description | | --- | --- | --- | | long | getActiveQueueItemId​(Player player) | Gets the id of the currently active queue item, or MediaSessionCompat.QueueItem.UNKNOWN_ID if the active item is unknown. | | long | getSupportedQueueNavigatorActions​(Player player) | Returns the actions which are supported by the navigator. | | default void | onCurrentMediaItemIndexChanged​(Player player) | Called when the current media item index changed. | | void | onSkipToNext​(Player player) | See MediaSessionCompat.Callback.onSkipToNext(). | | void | onSkipToPrevious​(Player player) | See MediaSessionCompat.Callback.onSkipToPrevious(). | | void | onSkipToQueueItem​(Player player, long id) | See MediaSessionCompat.Callback.onSkipToQueueItem(long). | | void | onTimelineChanged​(Player player) | Called when the timeline of the player has changed. |

- 

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

- 

getSupportedQueueNavigatorActions

long getSupportedQueueNavigatorActions​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Returns the actions which are supported by the navigator. The supported actions must be a bitmask combined out of PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM, PlaybackStateCompat.ACTION_SKIP_TO_NEXT, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS. Parameters:player - The player connected to the media session.Returns:The bitmask of the supported media actions.

- 

onTimelineChanged

void onTimelineChanged​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Called when the timeline of the player has changed. Parameters:player - The player connected to the media session.

- 

onCurrentMediaItemIndexChanged

default void onCurrentMediaItemIndexChanged​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Called when the current media item index changed. Parameters:player - The player connected to the media session.

- 

getActiveQueueItemId

long getActiveQueueItemId​(@Nullable[Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Gets the id of the currently active queue item, or MediaSessionCompat.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().

Parameters:player - The player connected to the media session.Returns:The id of the active queue item.

- 

onSkipToPrevious

void onSkipToPrevious​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

See MediaSessionCompat.Callback.onSkipToPrevious(). Parameters:player - The player connected to the media session.

- 

onSkipToQueueItem

void onSkipToQueueItem​([Player](../../Player.html "interface in com.google.android.exoplayer2")player,
                       long id)

See MediaSessionCompat.Callback.onSkipToQueueItem(long). Parameters:player - The player connected to the media session.

- 

onSkipToNext

void onSkipToNext​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

See MediaSessionCompat.Callback.onSkipToNext(). Parameters:player - The player connected to the media session.