public final class SinglePeriodAdTimeline extends ForwardingTimeline
Timeline for sources that have ads.Timeline.Period, Timeline.Windowtimeline| Constructor and Description |
|---|
SinglePeriodAdTimeline(Timeline contentTimeline,
AdPlaybackState adPlaybackState)
Creates a new timeline with a single period containing ads.
|
| Modifier and Type | Method and Description |
|---|---|
Timeline.Period |
getPeriod(int periodIndex,
Timeline.Period period,
boolean setIds)
Populates a
Timeline.Period with data for the period at the specified index. |
Timeline.Window |
getWindow(int windowIndex,
Timeline.Window window,
boolean setTag,
long defaultPositionProjectionUs)
Populates a
Timeline.Window with data for the window at the specified index. |
getFirstWindowIndex, getIndexOfPeriod, getLastWindowIndex, getNextWindowIndex, getPeriodCount, getPreviousWindowIndex, getUidOfPeriod, getWindowCountgetNextPeriodIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getWindow, getWindow, isEmpty, isLastPeriodpublic SinglePeriodAdTimeline(Timeline contentTimeline, AdPlaybackState adPlaybackState)
contentTimeline - The timeline of the content alongside which ads will be played. It must
have one window and one period.adPlaybackState - The state of the period's ads.public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
TimelineTimeline.Period with data for the period at the specified index.getPeriod in class ForwardingTimelineperiodIndex - 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 Timeline.Window getWindow(int windowIndex, Timeline.Window window, boolean setTag, long defaultPositionProjectionUs)
TimelineTimeline.Window with data for the window at the specified index.getWindow in class ForwardingTimelinewindowIndex - The index of the window.window - The Timeline.Window to populate. Must not be null.setTag - Whether Timeline.Window.tag should be populated. If false, the field will be set
to null. The caller should pass false for efficiency reasons unless the field is required.defaultPositionProjectionUs - A duration into the future that the populated window's
default start position should be projected.Timeline.Window, for convenience.