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.QueueNavigator
that maps the windows of aPlayer
'sTimeline
to the media session queue.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_QUEUE_SIZE
Deprecated.-
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 givenMediaSessionCompat
and maximum queue size.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
getActiveQueueItemId(Player player)
Deprecated.Gets the id of the currently active queue item, orMediaSessionCompat.QueueItem.UNKNOWN_ID
if the active item is unknown.abstract android.support.v4.media.MediaDescriptionCompat
getMediaDescription(Player player, int windowIndex)
Deprecated.Gets theMediaDescriptionCompat
for a given timeline window index.long
getSupportedQueueNavigatorActions(Player player)
Deprecated.Returns the actions which are supported by the navigator.boolean
onCommand(Player player, String command, Bundle extras, ResultReceiver cb)
Deprecated.SeeMediaSessionCompat.Callback.onCommand(String, Bundle, ResultReceiver)
.void
onCurrentMediaItemIndexChanged(Player player)
Deprecated.Called when the current media item index changed.void
onSkipToNext(Player player)
Deprecated.SeeMediaSessionCompat.Callback.onSkipToNext()
.void
onSkipToPrevious(Player player)
Deprecated.SeeMediaSessionCompat.Callback.onSkipToPrevious()
.void
onSkipToQueueItem(Player player, long id)
Deprecated.SeeMediaSessionCompat.Callback.onSkipToQueueItem(long)
.void
onTimelineChanged(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 givenMediaSessionCompat
and maximum queue size.If the number of windows in the
Player
'sTimeline
exceedsmaxQueueSize
, the media session queue will correspond tomaxQueueSize
windows 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 theMediaDescriptionCompat
for a given timeline window index.Often artworks and icons need to be loaded asynchronously. In such a case, return a
MediaDescriptionCompat
without 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.QueueNavigator
Returns 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:
getSupportedQueueNavigatorActions
in 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.QueueNavigator
Called when the timeline of the player has changed.- Specified by:
onTimelineChanged
in interfaceMediaSessionConnector.QueueNavigator
- Parameters:
player
- The player connected to the media session.
-
onCurrentMediaItemIndexChanged
public final void onCurrentMediaItemIndexChanged(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigator
Called when the current media item index changed.- Specified by:
onCurrentMediaItemIndexChanged
in 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.QueueNavigator
Gets the id of the currently active queue item, orMediaSessionCompat.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()
.- Specified by:
getActiveQueueItemId
in 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.QueueNavigator
SeeMediaSessionCompat.Callback.onSkipToPrevious()
.- Specified by:
onSkipToPrevious
in 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.QueueNavigator
SeeMediaSessionCompat.Callback.onSkipToQueueItem(long)
.- Specified by:
onSkipToQueueItem
in interfaceMediaSessionConnector.QueueNavigator
- Parameters:
player
- The player connected to the media session.
-
onSkipToNext
public void onSkipToNext(Player player)
Deprecated.Description copied from interface:MediaSessionConnector.QueueNavigator
SeeMediaSessionCompat.Callback.onSkipToNext()
.- Specified by:
onSkipToNext
in 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.CommandReceiver
SeeMediaSessionCompat.Callback.onCommand(String, Bundle, ResultReceiver)
. The receiver may handle the command, but is not required to do so.- Specified by:
onCommand
in 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.
-
-