Back to Exoplayer

SinglePeriodAdTimeline (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/ads/SinglePeriodAdTimeline.html

latest5.5 KB
Original Source

Package com.google.android.exoplayer2.source.ads

Class SinglePeriodAdTimeline


[@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.

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>

Field Summary

- 

Fields inherited from class com.google.android.exoplayer2.source.ForwardingTimeline

timeline

- 

Fields inherited from class com.google.android.exoplayer2.Timeline

CREATOR, EMPTY

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | SinglePeriodAdTimeline​(Timeline contentTimeline, AdPlaybackState adPlaybackState) | Deprecated.

Creates a new timeline with a single period containing ads. |

Method Summary

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. |

- 

Methods inherited from class com.google.android.exoplayer2.source.ForwardingTimeline

getFirstWindowIndex, getIndexOfPeriod, getLastWindowIndex, getNextWindowIndex, getPeriodCount, getPreviousWindowIndex, getUidOfPeriod, getWindow, getWindowCount

- 

Methods inherited from class com.google.android.exoplayer2.Timeline

equals, getNextPeriodIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPeriodPositionUs, getPeriodPositionUs, getWindow, hashCode, isEmpty, isLastPeriod, toBundle, toBundleWithOneWindowOnly

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

SinglePeriodAdTimeline

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.

Method Detail

- 

getPeriod

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.