public final class

FakeTimeline.TimelineWindowDefinition

extends java.lang.Object

 java.lang.Object

↳androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition

Overview

Definition used to define a FakeTimeline.

Summary

Fields
public final java.util.List<AdPlaybackState>adPlaybackStates

public static final longDEFAULT_WINDOW_DURATION_US

Default window duration in microseconds.

public static final longDEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

Default offset of a window in its first period in microseconds.

public final longdefaultPositionUs

public final longdurationUs

public final java.lang.Objectid

public final booleanisDynamic

public final booleanisLive

public final booleanisPlaceholder

public final booleanisSeekable

public final MediaItemmediaItem

public final intperiodCount

public final longwindowOffsetInFirstPeriodUs

Constructors
publicTimelineWindowDefinition(boolean isSeekable, boolean isDynamic, long durationUs)

Creates a window definition with one period.

publicTimelineWindowDefinition(int periodCount, java.lang.Object id)

Creates a seekable, non-dynamic window definition with a duration of FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_DURATION_US.

publicTimelineWindowDefinition(int periodCount, java.lang.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.

publicTimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, AdPlaybackState adPlaybackState, MediaItem mediaItem)

publicTimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, java.util.List<AdPlaybackState> adPlaybackStates, MediaItem mediaItem)

Creates a window definition with ad groups and a custom media item.

publicTimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, long durationUs)

Creates a window definition.

publicTimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, long durationUs, AdPlaybackState adPlaybackState)

Creates a window definition with ad groups.

Methods
public static FakeTimeline.TimelineWindowDefinitioncreatePlaceholder(java.lang.Object tag)

Creates a window definition that corresponds to a placeholder timeline using the given tag.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final long DEFAULT_WINDOW_DURATION_US

Default window duration in microseconds.

public static final long DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

Default offset of a window in its first period in microseconds.

public final int periodCount

public final java.lang.Object id

public final MediaItem mediaItem

public final boolean isSeekable

public final boolean isDynamic

public final boolean isLive

public final boolean isPlaceholder

public final long durationUs

public final long defaultPositionUs

public final long windowOffsetInFirstPeriodUs

public final java.util.List<AdPlaybackState> adPlaybackStates

Constructors

public TimelineWindowDefinition(int periodCount, java.lang.Object id)

Creates a seekable, non-dynamic window definition with a duration of FakeTimeline.TimelineWindowDefinition.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.

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.

public TimelineWindowDefinition(int periodCount, java.lang.Object 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.

public TimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, long durationUs, AdPlaybackState 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.

public TimelineWindowDefinition(int periodCount, java.lang.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.

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.

public TimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, AdPlaybackState adPlaybackState, MediaItem mediaItem)

Deprecated: Use FakeTimeline.TimelineWindowDefinition instead.

public TimelineWindowDefinition(int periodCount, java.lang.Object id, boolean isSeekable, boolean isDynamic, boolean isLive, boolean isPlaceholder, long durationUs, long defaultPositionUs, long windowOffsetInFirstPeriodUs, java.util.List<AdPlaybackState> adPlaybackStates, MediaItem 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.

Methods

public static FakeTimeline.TimelineWindowDefinition createPlaceholder(java.lang.Object tag)

Creates a window definition that corresponds to a placeholder timeline using the given tag.

Parameters:

tag: The tag to use in the timeline.