Back to Exoplayer

FakeTimeline.TimelineWindowDefinition (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/FakeTimeline.TimelineWindowDefinition.html

latest13.6 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class FakeTimeline.TimelineWindowDefinition


public static final classFakeTimeline.TimelineWindowDefinitionextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Definition used to define a FakeTimeline.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | List<AdPlaybackState> | adPlaybackStates | | | static long | DEFAULT_WINDOW_DURATION_US | Default window duration in microseconds. | | static long | DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US | Default offset of a window in its first period in microseconds. | | long | defaultPositionUs | | | long | durationUs | | | Object | id | | | boolean | isDynamic | | | boolean | isLive | | | boolean | isPlaceholder | | | boolean | isSeekable | | | MediaItem | mediaItem | | | int | periodCount | | | long | windowOffsetInFirstPeriodUs | |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | TimelineWindowDefinition​(boolean isSeekable, boolean isDynamic, long durationUs) | Creates a window definition with one period. | | TimelineWindowDefinition​(int periodCount, Object id) | Creates a seekable, non-dynamic window definition with a duration of DEFAULT_WINDOW_DURATION_US. | | TimelineWindowDefinition​(int periodCount, Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, AdPlaybackState adPlaybackState) | Creates a window definition with ad groups. | | TimelineWindowDefinition​(int periodCount, Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, AdPlaybackState adPlaybackState, MediaItem mediaItem) | Deprecated. Use TimelineWindowDefinition(int, Object, boolean, boolean, boolean, boolean, long, long, long, List, MediaItem) instead.

| | TimelineWindowDefinition​(int periodCount, Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, List<AdPlaybackState> adPlaybackStates, MediaItem mediaItem) | Creates a window definition with ad groups and a custom media item. | | TimelineWindowDefinition​(int periodCount, Object id, boolean isSeekable, boolean isDynamic, long durationUs) | Creates a window definition. | | TimelineWindowDefinition​(int periodCount, Object id, boolean isSeekable, boolean isDynamic, long durationUs, AdPlaybackState adPlaybackState) | Creates a window definition with ad groups. |

Method Summary

All Methods Static Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static FakeTimeline.TimelineWindowDefinition | createPlaceholder​(Object tag) | Creates a window definition that corresponds to a placeholder timeline using the given tag. |

- 

Methods inherited from class java.lang.Object

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

Field Detail

- 

DEFAULT_WINDOW_DURATION_US

public static final long DEFAULT_WINDOW_DURATION_US

Default window duration in microseconds. See Also:Constant Field Values

- 

DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

public static final long DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

Default offset of a window in its first period in microseconds. See Also:Constant Field Values

- 

periodCount

public final int periodCount
- 

id

public final[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id
- 

mediaItem

public final[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem
- 

isSeekable

public final boolean isSeekable
- 

isDynamic

public final boolean isDynamic
- 

isLive

public final boolean isLive
- 

isPlaceholder

public final boolean isPlaceholder
- 

durationUs

public final long durationUs
- 

defaultPositionUs

public final long defaultPositionUs
- 

windowOffsetInFirstPeriodUs

public final long windowOffsetInFirstPeriodUs
- 

adPlaybackStates

public final[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[AdPlaybackState](../source/ads/AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")> adPlaybackStates

Constructor Detail

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id)

Creates a seekable, non-dynamic window definition with a duration of DEFAULT_WINDOW_DURATION_US. Parameters:periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.id - The UID of the window.

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(boolean isSeekable,
                                boolean isDynamic,
                                long durationUs)

Creates a window definition with one period. Parameters:isSeekable - Whether the window is seekable.isDynamic - Whether the window is dynamic.durationUs - The duration of the window in microseconds.

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id,
                                boolean isSeekable,
                                boolean isDynamic,
                                long durationUs)

Creates a window definition. Parameters:periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.id - The UID of the window.isSeekable - Whether the window is seekable.isDynamic - Whether the window is dynamic.durationUs - The duration of the window in microseconds.

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id,
                                boolean isSeekable,
                                boolean isDynamic,
                                long durationUs,[AdPlaybackState](../source/ads/AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")adPlaybackState)

Creates a window definition with ad groups. Parameters:periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.id - The UID of the window.isSeekable - Whether the window is seekable.isDynamic - Whether the window is dynamic.durationUs - The duration of the window in microseconds.adPlaybackState - The ad playback state.

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id,
                                boolean isSeekable,
                                boolean isDynamic,
                                boolean isLive,
                                boolean isPlaceholder,
                                long durationUs,
                                long defaultPositionUs,
                                long windowOffsetInFirstPeriodUs,[AdPlaybackState](../source/ads/AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")adPlaybackState)

Creates a window definition with ad groups. Parameters:periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.id - The UID of the window.isSeekable - Whether the window is seekable.isDynamic - Whether the window is dynamic.isLive - Whether the window is live.isPlaceholder - Whether the window is a placeholder.durationUs - The duration of the window in microseconds.defaultPositionUs - The default position of the window in microseconds.windowOffsetInFirstPeriodUs - The offset of the window in the first period, in microseconds.adPlaybackState - The ad playback state.

- 

TimelineWindowDefinition

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id,
                                boolean isSeekable,
                                boolean isDynamic,
                                boolean isLive,
                                boolean isPlaceholder,
                                long durationUs,
                                long defaultPositionUs,
                                long windowOffsetInFirstPeriodUs,[AdPlaybackState](../source/ads/AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")adPlaybackState,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Deprecated. Use TimelineWindowDefinition(int, Object, boolean, boolean, boolean, boolean, long, long, long, List, MediaItem) instead.

- 

TimelineWindowDefinition

public TimelineWindowDefinition​(int periodCount,[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")id,
                                boolean isSeekable,
                                boolean isDynamic,
                                boolean isLive,
                                boolean isPlaceholder,
                                long durationUs,
                                long defaultPositionUs,
                                long windowOffsetInFirstPeriodUs,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[AdPlaybackState](../source/ads/AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")> adPlaybackStates,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Creates a window definition with ad groups and a custom media item. Parameters:periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.id - The UID of the window.isSeekable - Whether the window is seekable.isDynamic - Whether the window is dynamic.isLive - Whether the window is live.isPlaceholder - Whether the window is a placeholder.durationUs - The duration of the window in microseconds.defaultPositionUs - The default position of the window in microseconds.windowOffsetInFirstPeriodUs - The offset of the window in the first period, in microseconds.adPlaybackStates - The ad playback states for the periods.mediaItem - The media item to include in the timeline.

Method Detail

- 

createPlaceholder

public static[FakeTimeline.TimelineWindowDefinition](FakeTimeline.TimelineWindowDefinition.html "class in com.google.android.exoplayer2.testutil")createPlaceholder​([Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")tag)

Creates a window definition that corresponds to a placeholder timeline using the given tag. Parameters:tag - The tag to use in the timeline.