Class TimelineQueueNavigator
- java.lang.Object
-
- com.google.android.exoplayer2.ext.mediasession.TimelineQueueNavigator
-
- All Implemented Interfaces:
MediaSessionConnector.CommandReceiver,MediaSessionConnector.QueueNavigator
@Deprecated public abstract class TimelineQueueNavigator extends Object implements MediaSessionConnector.QueueNavigator
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.An abstract implementation of theMediaSessionConnector.QueueNavigatorthat maps the windows of aPlayer'sTimelineto the media session queue.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_QUEUE_SIZEDeprecated.-
Fields inherited from interface com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector.QueueNavigator
ACTIONS
-
-
Constructor Summary
Constructors Constructor Description TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession)Deprecated.Creates an instance for a givenMediaSessionCompat.TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession, int maxQueueSize)Deprecated.Creates an instance for a givenMediaSessionCompatand maximum queue size.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetActiveQueueItemId(Player player)Deprecated.Gets the id of the currently active queue item, orMediaSessionCompat.QueueItem.UNKNOWN_IDif the active item is unknown.abstract android.support.v4.media.MediaDescriptionCompatgetMediaDescription(Player player, int windowIndex)Deprecated.Gets theMediaDescriptionCompatfor a given timeline window index.longgetSupportedQueueNavigatorActions(Player player)Deprecated.Returns the actions which are supported by the navigator.booleanonCommand(Player player, String command, Bundle extras, ResultReceiver cb)Deprecated.SeeMediaSessionCompat.Callback.onCommand(String, Bundle, ResultReceiver).voidonCurrentMediaItemIndexChanged(Player player)Deprecated.Called when the current media item index changed.voidonSkipToNext(Player player)Deprecated.SeeMediaSessionCompat.Callback.onSkipToNext().voidonSkipToPrevious(Player player)Deprecated.SeeMediaSessionCompat.Callback.onSkipToPrevious().voidonSkipToQueueItem(Player player, long id)Deprecated.SeeMediaSessionCompat.Callback.onSkipToQueueItem(long).voidonTimelineChanged(Player player)Deprecated.Called when the timeline of the player has changed.
-
-
-
Field Detail
-
DEFAULT_MAX_QUEUE_SIZE
public static final int DEFAULT_MAX_QUEUE_SIZE
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimelineQueueNavigator
public TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession)
Deprecated.Creates an instance for a givenMediaSessionCompat.Equivalent to
TimelineQueueNavigator(mediaSession, DEFAULT_MAX_QUEUE_SIZE).- Parameters:
mediaSession- TheMediaSessionCompat.
-
TimelineQueueNavigator
public TimelineQueueNavigator(android.support.v4.media.session.MediaSessionCompat mediaSession, int maxQueueSize)Deprecated.Creates an instance for a givenMediaSessionCompatand maximum queue size.If the number of windows in the
Player'sTimelineexceedsmaxQueueSize, the media session queue will correspond tomaxQueueSizewindows centered on the one currently being played.- Parameters:
mediaSession- TheMediaSessionCompat.maxQueueSize- The maximum queue size.
-
-
Method Detail
-
getMediaDescription
public abstract android.support.v4.media.MediaDescriptionCompat getMediaDescription(Player player, int windowIndex)
Deprecated.Gets theMediaDescriptionCompatfor a given timeline window index.Often artworks and icons need to be loaded asynchronously. In such a case, return a
MediaDescriptionCompatwithout the images, load your images asynchronously off the main thread and then callMediaSessionConnector.invalidateMediaSessionQueue()to make the connector update the queue by calling this method again.- Parameters:
player- The current player.windowIndex- The timeline window index for which to provide a description.- Returns:
- A
MediaDescriptionCompat.
-
getSupportedQueueNavigatorActions
public long getSupportedQueueNavigatorActions(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorReturns the actions which are supported by the navigator. The supported actions must be a bitmask combined out ofPlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM,PlaybackStateCompat.ACTION_SKIP_TO_NEXT,PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS.- Specified by:
getSupportedQueueNavigatorActionsin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.- Returns:
- The bitmask of the supported media actions.
-
onTimelineChanged
public final void onTimelineChanged(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorCalled when the timeline of the player has changed.- Specified by:
onTimelineChangedin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.
-
onCurrentMediaItemIndexChanged
public final void onCurrentMediaItemIndexChanged(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorCalled when the current media item index changed.- Specified by:
onCurrentMediaItemIndexChangedin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.
-
getActiveQueueItemId
public final long getActiveQueueItemId(@Nullable Player player)Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorGets the id of the currently active queue item, orMediaSessionCompat.QueueItem.UNKNOWN_IDif 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().- Specified by:
getActiveQueueItemIdin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.- Returns:
- The id of the active queue item.
-
onSkipToPrevious
public void onSkipToPrevious(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorSeeMediaSessionCompat.Callback.onSkipToPrevious().- Specified by:
onSkipToPreviousin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.
-
onSkipToQueueItem
public void onSkipToQueueItem(Player player, long id)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorSeeMediaSessionCompat.Callback.onSkipToQueueItem(long).- Specified by:
onSkipToQueueItemin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.
-
onSkipToNext
public void onSkipToNext(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigatorSeeMediaSessionCompat.Callback.onSkipToNext().- Specified by:
onSkipToNextin interfaceMediaSessionConnector.QueueNavigator- Parameters:
player- The player connected to the media session.
-
onCommand
public boolean onCommand(Player player, String command, @Nullable Bundle extras, @Nullable ResultReceiver cb)
Deprecated.Description copied from interface:MediaSessionConnector.CommandReceiverSeeMediaSessionCompat.Callback.onCommand(String, Bundle, ResultReceiver). The receiver may handle the command, but is not required to do so.- Specified by:
onCommandin interfaceMediaSessionConnector.CommandReceiver- Parameters:
player- The player connected to the media session.command- The command name.extras- Optional parameters for the command, may be null.cb- A result receiver to which a result may be sent by the command, may be null.- Returns:
- Whether the receiver handled the command.
-
-