FakeTimeline.TimelineWindowDefinition


public final class FakeTimeline.TimelineWindowDefinition


Definition used to define a FakeTimeline.

Summary

Constants

static final long

Default window duration in microseconds.

static final long

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

Public fields

final List<AdPlaybackState>
final long
final long
final Object
final boolean
final boolean
final boolean
final boolean
final MediaItem
final int
final long

Public constructors

TimelineWindowDefinition(int periodCount, Object id)

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

TimelineWindowDefinition(
    boolean isSeekable,
    boolean isDynamic,
    long durationUs
)

Creates a window definition with one period.

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.

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
)

This method is deprecated.

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

Public methods

static FakeTimeline.TimelineWindowDefinition

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

Constants

DEFAULT_WINDOW_DURATION_US

public static final long DEFAULT_WINDOW_DURATION_US = 10000000

Default window duration in microseconds.

DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

public static final long DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US = 123000000

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

Public fields

adPlaybackStates

public final List<AdPlaybackStateadPlaybackStates

defaultPositionUs

public final long defaultPositionUs

durationUs

public final long durationUs

id

public final Object id

isDynamic

public final boolean isDynamic

isLive

public final boolean isLive

isPlaceholder

public final boolean isPlaceholder

isSeekable

public final boolean isSeekable

mediaItem

public final MediaItem mediaItem

periodCount

public final int periodCount

windowOffsetInFirstPeriodUs

public final long windowOffsetInFirstPeriodUs

Public constructors

TimelineWindowDefinition

public TimelineWindowDefinition(int periodCount, Object id)

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

Parameters
int periodCount

The number of periods in the window. Each period get an equal slice of the total window duration.

Object id

The UID of the window.

TimelineWindowDefinition

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

Creates a window definition with one period.

Parameters
boolean isSeekable

Whether the window is seekable.

boolean isDynamic

Whether the window is dynamic.

long durationUs

The duration of the window in microseconds.

TimelineWindowDefinition

public TimelineWindowDefinition(
    int periodCount,
    Object id,
    boolean isSeekable,
    boolean isDynamic,
    long durationUs
)

Creates a window definition.

Parameters
int periodCount

The number of periods in the window. Each period get an equal slice of the total window duration.

Object id

The UID of the window.

boolean isSeekable

Whether the window is seekable.

boolean isDynamic

Whether the window is dynamic.

long durationUs

The duration of the window in microseconds.

TimelineWindowDefinition

public TimelineWindowDefinition(
    int periodCount,
    Object id,
    boolean isSeekable,
    boolean isDynamic,
    long durationUs,
    AdPlaybackState adPlaybackState
)

Creates a window definition with ad groups.

Parameters
int periodCount

The number of periods in the window. Each period get an equal slice of the total window duration.

Object id

The UID of the window.

boolean isSeekable

Whether the window is seekable.

boolean isDynamic

Whether the window is dynamic.

long durationUs

The duration of the window in microseconds.

AdPlaybackState adPlaybackState

The ad playback state.

TimelineWindowDefinition

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

Parameters
int periodCount

The number of periods in the window. Each period get an equal slice of the total window duration.

Object id

The UID of the window.

boolean isSeekable

Whether the window is seekable.

boolean isDynamic

Whether the window is dynamic.

boolean isLive

Whether the window is live.

boolean isPlaceholder

Whether the window is a placeholder.

long durationUs

The duration of the window in microseconds.

long defaultPositionUs

The default position of the window in microseconds.

long windowOffsetInFirstPeriodUs

The offset of the window in the first period, in microseconds.

AdPlaybackState adPlaybackState

The ad playback state.

TimelineWindowDefinition

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

TimelineWindowDefinition

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

Parameters
int periodCount

The number of periods in the window. Each period get an equal slice of the total window duration.

Object id

The UID of the window.

boolean isSeekable

Whether the window is seekable.

boolean isDynamic

Whether the window is dynamic.

boolean isLive

Whether the window is live.

boolean isPlaceholder

Whether the window is a placeholder.

long durationUs

The duration of the window in microseconds.

long defaultPositionUs

The default position of the window in microseconds.

long windowOffsetInFirstPeriodUs

The offset of the window in the first period, in microseconds.

List<AdPlaybackState> adPlaybackStates

The ad playback states for the periods.

MediaItem mediaItem

The media item to include in the timeline.

Public methods

createPlaceholder

public static FakeTimeline.TimelineWindowDefinition createPlaceholder(Object tag)

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

Parameters
Object tag

The tag to use in the timeline.