public final class

MediaSession.MediaItemsWithStartPosition

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.MediaSession.MediaItemsWithStartPosition

Overview

Representation of a list of media items and where to start playing.

Summary

Fields
public final <any>mediaItems

List of media items.

public final intstartIndex

Index to start playing at in MediaSession.MediaItemsWithStartPosition.mediaItems.

public final longstartPositionMs

Position in milliseconds to start playing from in the starting media item.

Constructors
publicMediaItemsWithStartPosition(java.util.List<MediaItem> mediaItems, int startIndex, long startPositionMs)

Creates an instance.

Methods
public booleanequals(java.lang.Object obj)

public inthashCode()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final <any> mediaItems

List of media items.

public final int startIndex

Index to start playing at in MediaSession.MediaItemsWithStartPosition.mediaItems.

The start index in MediaSession.MediaItemsWithStartPosition.mediaItems from which to start playing, or C.INDEX_UNSET to start playing from the default index in the playlist.

public final long startPositionMs

Position in milliseconds to start playing from in the starting media item.

The starting position in the media item from where to start playing, or C.TIME_UNSET to start playing from the default position in the media item. This value is ignored if startIndex is C.INDEX_UNSET.

Constructors

public MediaItemsWithStartPosition(java.util.List<MediaItem> mediaItems, int startIndex, long startPositionMs)

Creates an instance.

Parameters:

mediaItems: List of media items.
startIndex: Index to start playing at in mediaItems, or C.INDEX_UNSET to start from the default index.
startPositionMs: Position in milliseconds to start playing from in the starting media item, or C.TIME_UNSET to start from the default position.

Methods

public boolean equals(java.lang.Object obj)

public int hashCode()