docs/doc/reference/com/google/android/exoplayer2/source/ads/SinglePeriodAdTimeline.html
Package com.google.android.exoplayer2.source.ads
All Implemented Interfaces:Bundleable
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classSinglePeriodAdTimelineextends[ForwardingTimeline](../ForwardingTimeline.html "class in com.google.android.exoplayer2.source")
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.
A Timeline for sources that have ads.
-
Timeline.Period, Timeline.RemotableTimeline, Timeline.Window
-
Bundleable.Creator<T extends Bundleable>
-
timeline
-
CREATOR, EMPTY
Constructors | Constructor | Description |
| --- | --- |
| SinglePeriodAdTimeline(Timeline contentTimeline, AdPlaybackState adPlaybackState) |
Deprecated.
Creates a new timeline with a single period containing ads. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| Timeline.Period | getPeriod(int periodIndex, Timeline.Period period, boolean setIds) |
Deprecated.
Populates a Timeline.Period with data for the period at the specified index.
|
-
getFirstWindowIndex, getIndexOfPeriod, getLastWindowIndex, getNextWindowIndex, getPeriodCount, getPreviousWindowIndex, getUidOfPeriod, getWindow, getWindowCount
-
equals, getNextPeriodIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPeriodPositionUs, getPeriodPositionUs, getWindow, hashCode, isEmpty, isLastPeriod, toBundle, toBundleWithOneWindowOnly
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
public SinglePeriodAdTimeline([Timeline](../../Timeline.html "class in com.google.android.exoplayer2")contentTimeline,[AdPlaybackState](AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")adPlaybackState)
Deprecated.
Creates a new timeline with a single period containing ads.
Parameters: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](../../Timeline.Period.html "class in com.google.android.exoplayer2")getPeriod(int periodIndex,[Timeline.Period](../../Timeline.Period.html "class in com.google.android.exoplayer2")period,
boolean setIds)
Deprecated.
Description copied from class: Timeline
Populates a Timeline.Period with data for the period at the specified index.
Overrides:getPeriod in class ForwardingTimelineParameters: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.Returns:The populated Timeline.Period, for convenience.