Class ForwardingTimeline
- java.lang.Object
-
- com.google.android.exoplayer2.Timeline
-
- com.google.android.exoplayer2.source.ForwardingTimeline
-
- All Implemented Interfaces:
Bundleable
- Direct Known Subclasses:
FakeMediaSource.InitialTimeline
,SinglePeriodAdTimeline
@Deprecated public abstract class ForwardingTimeline extends Timeline
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 overridableTimeline
implementation forwarding all methods to another timeline.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.Timeline
Timeline.Period, Timeline.RemotableTimeline, Timeline.Window
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Constructor Summary
Constructors Constructor Description ForwardingTimeline(Timeline timeline)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getFirstWindowIndex(boolean shuffleModeEnabled)
Deprecated.Returns the index of the first window in the playback order depending on whether shuffling is enabled.int
getIndexOfPeriod(Object uid)
Deprecated.Returns the index of the period identified by its uniqueTimeline.Period.uid
, orC.INDEX_UNSET
if the period is not in the timeline.int
getLastWindowIndex(boolean shuffleModeEnabled)
Deprecated.Returns the index of the last window in the playback order depending on whether shuffling is enabled.int
getNextWindowIndex(int windowIndex, @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)
Deprecated.Returns the index of the window after the window at indexwindowIndex
depending on therepeatMode
and whether shuffling is enabled.Timeline.Period
getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Deprecated.Populates aTimeline.Period
with data for the period at the specified index.int
getPeriodCount()
Deprecated.Returns the number of periods in the timeline.int
getPreviousWindowIndex(int windowIndex, @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)
Deprecated.Returns the index of the window before the window at indexwindowIndex
depending on therepeatMode
and whether shuffling is enabled.Object
getUidOfPeriod(int periodIndex)
Deprecated.Returns the unique id of the period identified by its index in the timeline.Timeline.Window
getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Deprecated.Populates aTimeline.Window
with data for the window at the specified index.int
getWindowCount()
Deprecated.Returns the number of windows in the timeline.-
Methods inherited from class com.google.android.exoplayer2.Timeline
equals, getNextPeriodIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPeriodPositionUs, getPeriodPositionUs, getWindow, hashCode, isEmpty, isLastPeriod, toBundle, toBundleWithOneWindowOnly
-
-
-
-
Field Detail
-
timeline
protected final Timeline timeline
Deprecated.
-
-
Constructor Detail
-
ForwardingTimeline
public ForwardingTimeline(Timeline timeline)
Deprecated.
-
-
Method Detail
-
getWindowCount
public int getWindowCount()
Deprecated.Description copied from class:Timeline
Returns the number of windows in the timeline.- Specified by:
getWindowCount
in classTimeline
-
getNextWindowIndex
public int getNextWindowIndex(int windowIndex, @RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)
Deprecated.Description copied from class:Timeline
Returns the index of the window after the window at indexwindowIndex
depending on therepeatMode
and whether shuffling is enabled.- Overrides:
getNextWindowIndex
in classTimeline
- Parameters:
windowIndex
- Index of a window in the timeline.repeatMode
- A repeat mode.shuffleModeEnabled
- Whether shuffling is enabled.- Returns:
- The index of the next window, or
C.INDEX_UNSET
if this is the last window.
-
getPreviousWindowIndex
public int getPreviousWindowIndex(int windowIndex, @RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)
Deprecated.Description copied from class:Timeline
Returns the index of the window before the window at indexwindowIndex
depending on therepeatMode
and whether shuffling is enabled.- Overrides:
getPreviousWindowIndex
in classTimeline
- Parameters:
windowIndex
- Index of a window in the timeline.repeatMode
- A repeat mode.shuffleModeEnabled
- Whether shuffling is enabled.- Returns:
- The index of the previous window, or
C.INDEX_UNSET
if this is the first window.
-
getLastWindowIndex
public int getLastWindowIndex(boolean shuffleModeEnabled)
Deprecated.Description copied from class:Timeline
Returns the index of the last window in the playback order depending on whether shuffling is enabled.- Overrides:
getLastWindowIndex
in classTimeline
- Parameters:
shuffleModeEnabled
- Whether shuffling is enabled.- Returns:
- The index of the last window in the playback order, or
C.INDEX_UNSET
if the timeline is empty.
-
getFirstWindowIndex
public int getFirstWindowIndex(boolean shuffleModeEnabled)
Deprecated.Description copied from class:Timeline
Returns the index of the first window in the playback order depending on whether shuffling is enabled.- Overrides:
getFirstWindowIndex
in classTimeline
- Parameters:
shuffleModeEnabled
- Whether shuffling is enabled.- Returns:
- The index of the first window in the playback order, or
C.INDEX_UNSET
if the timeline is empty.
-
getWindow
public Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Deprecated.Description copied from class:Timeline
Populates aTimeline.Window
with data for the window at the specified index.- Specified by:
getWindow
in classTimeline
- Parameters:
windowIndex
- The index of the window.window
- TheTimeline.Window
to populate. Must not be null.defaultPositionProjectionUs
- A duration into the future that the populated window's default start position should be projected.- Returns:
- The populated
Timeline.Window
, for convenience.
-
getPeriodCount
public int getPeriodCount()
Deprecated.Description copied from class:Timeline
Returns the number of periods in the timeline.- Specified by:
getPeriodCount
in classTimeline
-
getPeriod
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Deprecated.Description copied from class:Timeline
Populates aTimeline.Period
with data for the period at the specified index.- Specified by:
getPeriod
in classTimeline
- Parameters:
periodIndex
- The index of the period.period
- TheTimeline.Period
to populate. Must not be null.setIds
- WhetherTimeline.Period.id
andTimeline.Period.uid
should be populated. If false, the fields will be set to null. The caller should pass false for efficiency reasons unless the fields are required.- Returns:
- The populated
Timeline.Period
, for convenience.
-
getIndexOfPeriod
public int getIndexOfPeriod(Object uid)
Deprecated.Description copied from class:Timeline
Returns the index of the period identified by its uniqueTimeline.Period.uid
, orC.INDEX_UNSET
if the period is not in the timeline.- Specified by:
getIndexOfPeriod
in classTimeline
- Parameters:
uid
- A unique identifier for a period.- Returns:
- The index of the period, or
C.INDEX_UNSET
if the period was not found.
-
getUidOfPeriod
public Object getUidOfPeriod(int periodIndex)
Deprecated.Description copied from class:Timeline
Returns the unique id of the period identified by its index in the timeline.- Specified by:
getUidOfPeriod
in classTimeline
- Parameters:
periodIndex
- The index of the period.- Returns:
- The unique id of the period.
-
-