Package com.google.android.exoplayer2
Class Timeline.RemotableTimeline
- java.lang.Object
-
- com.google.android.exoplayer2.Timeline
-
- com.google.android.exoplayer2.Timeline.RemotableTimeline
-
- All Implemented Interfaces:
Bundleable
- Enclosing class:
- Timeline
public static final class Timeline.RemotableTimeline extends 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 RemotableTimeline(ImmutableList<Timeline.Window> windows, ImmutableList<Timeline.Period> periods, int[] shuffledWindowIndices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFirstWindowIndex(boolean shuffleModeEnabled)Returns the index of the first window in the playback order depending on whether shuffling is enabled.intgetIndexOfPeriod(Object uid)Returns the index of the period identified by its uniqueTimeline.Period.uid, orC.INDEX_UNSETif the period is not in the timeline.intgetLastWindowIndex(boolean shuffleModeEnabled)Returns the index of the last window in the playback order depending on whether shuffling is enabled.intgetNextWindowIndex(int windowIndex, @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)Returns the index of the window after the window at indexwindowIndexdepending on therepeatModeand whether shuffling is enabled.Timeline.PeriodgetPeriod(int periodIndex, Timeline.Period period, boolean setIds)Populates aTimeline.Periodwith data for the period at the specified index.intgetPeriodCount()Returns the number of periods in the timeline.intgetPreviousWindowIndex(int windowIndex, @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)Returns the index of the window before the window at indexwindowIndexdepending on therepeatModeand whether shuffling is enabled.ObjectgetUidOfPeriod(int periodIndex)Returns the unique id of the period identified by its index in the timeline.Timeline.WindowgetWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)Populates aTimeline.Windowwith data for the window at the specified index.intgetWindowCount()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
-
-
-
-
Constructor Detail
-
RemotableTimeline
public RemotableTimeline(ImmutableList<Timeline.Window> windows, ImmutableList<Timeline.Period> periods, int[] shuffledWindowIndices)
-
-
Method Detail
-
getWindowCount
public int getWindowCount()
Description copied from class:TimelineReturns the number of windows in the timeline.- Specified by:
getWindowCountin classTimeline
-
getWindow
public Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Description copied from class:TimelinePopulates aTimeline.Windowwith data for the window at the specified index.- Specified by:
getWindowin classTimeline- Parameters:
windowIndex- The index of the window.window- TheTimeline.Windowto 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.
-
getNextWindowIndex
public int getNextWindowIndex(int windowIndex, @RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)Description copied from class:TimelineReturns the index of the window after the window at indexwindowIndexdepending on therepeatModeand whether shuffling is enabled.- Overrides:
getNextWindowIndexin 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_UNSETif this is the last window.
-
getPreviousWindowIndex
public int getPreviousWindowIndex(int windowIndex, @RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode, boolean shuffleModeEnabled)Description copied from class:TimelineReturns the index of the window before the window at indexwindowIndexdepending on therepeatModeand whether shuffling is enabled.- Overrides:
getPreviousWindowIndexin 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_UNSETif this is the first window.
-
getLastWindowIndex
public int getLastWindowIndex(boolean shuffleModeEnabled)
Description copied from class:TimelineReturns the index of the last window in the playback order depending on whether shuffling is enabled.- Overrides:
getLastWindowIndexin classTimeline- Parameters:
shuffleModeEnabled- Whether shuffling is enabled.- Returns:
- The index of the last window in the playback order, or
C.INDEX_UNSETif the timeline is empty.
-
getFirstWindowIndex
public int getFirstWindowIndex(boolean shuffleModeEnabled)
Description copied from class:TimelineReturns the index of the first window in the playback order depending on whether shuffling is enabled.- Overrides:
getFirstWindowIndexin classTimeline- Parameters:
shuffleModeEnabled- Whether shuffling is enabled.- Returns:
- The index of the first window in the playback order, or
C.INDEX_UNSETif the timeline is empty.
-
getPeriodCount
public int getPeriodCount()
Description copied from class:TimelineReturns the number of periods in the timeline.- Specified by:
getPeriodCountin classTimeline
-
getPeriod
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Description copied from class:TimelinePopulates aTimeline.Periodwith data for the period at the specified index.- Specified by:
getPeriodin classTimeline- Parameters:
periodIndex- The index of the period.period- TheTimeline.Periodto populate. Must not be null.setIds- WhetherTimeline.Period.idandTimeline.Period.uidshould 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)
Description copied from class:TimelineReturns the index of the period identified by its uniqueTimeline.Period.uid, orC.INDEX_UNSETif the period is not in the timeline.- Specified by:
getIndexOfPeriodin classTimeline- Parameters:
uid- A unique identifier for a period.- Returns:
- The index of the period, or
C.INDEX_UNSETif the period was not found.
-
getUidOfPeriod
public Object getUidOfPeriod(int periodIndex)
Description copied from class:TimelineReturns the unique id of the period identified by its index in the timeline.- Specified by:
getUidOfPeriodin classTimeline- Parameters:
periodIndex- The index of the period.- Returns:
- The unique id of the period.
-
-