public static final class MaskingMediaSource.PlaceholderTimeline extends Timeline
Timeline.Period, Timeline.Window
Constructor | Description |
---|---|
PlaceholderTimeline(MediaItem mediaItem) |
Creates a new instance with the given media item.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getIndexOfPeriod(Object uid) |
Returns the index of the period identified by its unique
Timeline.Period.uid , or C.INDEX_UNSET if the period is not in the timeline. |
Timeline.Period |
getPeriod(int periodIndex,
Timeline.Period period,
boolean setIds) |
Populates a
Timeline.Period with data for the period at the specified index. |
int |
getPeriodCount() |
Returns the number of periods in the timeline.
|
Object |
getUidOfPeriod(int periodIndex) |
Returns the unique id of the period identified by its index in the timeline.
|
Timeline.Window |
getWindow(int windowIndex,
Timeline.Window window,
long defaultPositionProjectionUs) |
Populates a
Timeline.Window with data for the window at the specified index. |
int |
getWindowCount() |
Returns the number of windows in the timeline.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
equals, getFirstWindowIndex, getLastWindowIndex, getNextPeriodIndex, getNextWindowIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPreviousWindowIndex, getWindow, getWindow, hashCode, isEmpty, isLastPeriod
public PlaceholderTimeline(MediaItem mediaItem)
public int getWindowCount()
Timeline
getWindowCount
in class Timeline
public Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Timeline
Timeline.Window
with data for the window at the specified index.getWindow
in class Timeline
windowIndex
- The index of the window.window
- The Timeline.Window
to populate. Must not be null.defaultPositionProjectionUs
- A duration into the future that the populated window's
default start position should be projected.Timeline.Window
, for convenience.public int getPeriodCount()
Timeline
getPeriodCount
in class Timeline
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Timeline
Timeline.Period
with data for the period at the specified index.getPeriod
in class Timeline
periodIndex
- The index of the period.period
- The Timeline.Period
to populate. Must not be null.setIds
- Whether Timeline.Period.id
and Timeline.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.Timeline.Period
, for convenience.public int getIndexOfPeriod(Object uid)
Timeline
Timeline.Period.uid
, or C.INDEX_UNSET
if the period is not in the timeline.getIndexOfPeriod
in class Timeline
uid
- A unique identifier for a period.C.INDEX_UNSET
if the period was not found.public Object getUidOfPeriod(int periodIndex)
Timeline
getUidOfPeriod
in class Timeline
periodIndex
- The index of the period.