Timeline.RemotableTimeline
@UnstableApi
public final class Timeline.RemotableTimeline extends Timeline
| java.lang.Object | ||
| ↳ | androidx.media3.common.Timeline | |
| ↳ | androidx.media3.common.Timeline.RemotableTimeline |
A concrete class of Timeline to restore a Timeline instance from a Bundle sent by another process via IBinder.
Summary
Public constructors |
|---|
RemotableTimeline( |
Public methods |
|
|---|---|
int |
getFirstWindowIndex(boolean shuffleModeEnabled)Returns the index of the first window in the playback order depending on whether shuffling is enabled. |
int |
getIndexOfPeriod(Object uid)Returns the index of the period identified by its unique |
int |
getLastWindowIndex(boolean shuffleModeEnabled)Returns the index of the last window in the playback order depending on whether shuffling is enabled. |
int |
getNextWindowIndex(Returns the index of the window after the window at index |
Timeline.Period |
getPeriod(int periodIndex, Timeline.Period period, boolean setIds)Populates a |
int |
Returns the number of periods in the timeline. |
int |
getPreviousWindowIndex(Returns the index of the window before the window at index |
Object |
getUidOfPeriod(int periodIndex)Returns the unique id of the period identified by its index in the timeline. |
Timeline.Window |
getWindow(Populates a |
int |
Returns the number of windows in the timeline. |
Inherited methods |
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
RemotableTimeline
public RemotableTimeline(
ImmutableList<Timeline.Window> windows,
ImmutableList<Timeline.Period> periods,
int[] shuffledWindowIndices
)
Public methods
getFirstWindowIndex
public int getFirstWindowIndex(boolean shuffleModeEnabled)
Returns the index of the first window in the playback order depending on whether shuffling is enabled.
| Parameters | |
|---|---|
boolean shuffleModeEnabled |
Whether shuffling is enabled. |
| Returns | |
|---|---|
int |
The index of the first window in the playback order, or |
getIndexOfPeriod
public int getIndexOfPeriod(Object uid)
Returns the index of the period identified by its unique uid, or INDEX_UNSET if the period is not in the timeline.
| Parameters | |
|---|---|
Object uid |
A unique identifier for a period. |
| Returns | |
|---|---|
int |
The index of the period, or |
getLastWindowIndex
public int getLastWindowIndex(boolean shuffleModeEnabled)
Returns the index of the last window in the playback order depending on whether shuffling is enabled.
| Parameters | |
|---|---|
boolean shuffleModeEnabled |
Whether shuffling is enabled. |
| Returns | |
|---|---|
int |
The index of the last window in the playback order, or |
getNextWindowIndex
public int getNextWindowIndex(
int windowIndex,
@Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled
)
Returns the index of the window after the window at index windowIndex depending on the repeatMode and whether shuffling is enabled.
| Parameters | |
|---|---|
int windowIndex |
Index of a window in the timeline. |
@Player.RepeatMode int repeatMode |
A repeat mode. |
boolean shuffleModeEnabled |
Whether shuffling is enabled. |
| Returns | |
|---|---|
int |
The index of the next window, or |
getPeriod
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Populates a Period with data for the period at the specified index.
| Parameters | |
|---|---|
int periodIndex |
The index of the period. |
Timeline.Period period |
The |
boolean setIds |
Whether |
| Returns | |
|---|---|
Timeline.Period |
The populated |
getPreviousWindowIndex
public int getPreviousWindowIndex(
int windowIndex,
@Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled
)
Returns the index of the window before the window at index windowIndex depending on the repeatMode and whether shuffling is enabled.
| Parameters | |
|---|---|
int windowIndex |
Index of a window in the timeline. |
@Player.RepeatMode int repeatMode |
A repeat mode. |
boolean shuffleModeEnabled |
Whether shuffling is enabled. |
| Returns | |
|---|---|
int |
The index of the previous window, or |
getUidOfPeriod
public Object getUidOfPeriod(int periodIndex)
Returns the unique id of the period identified by its index in the timeline.
| Parameters | |
|---|---|
int periodIndex |
The index of the period. |
| Returns | |
|---|---|
Object |
The unique id of the period. |
getWindow
public Timeline.Window getWindow(
int windowIndex,
Timeline.Window window,
long defaultPositionProjectionUs
)
Populates a Window with data for the window at the specified index.
| Parameters | |
|---|---|
int windowIndex |
The index of the window. |
Timeline.Window window |
The |
long defaultPositionProjectionUs |
A duration into the future that the populated window's default start position should be projected. |
| Returns | |
|---|---|
Timeline.Window |
The populated |