Package com.google.android.exoplayer2.testutil

## Class FakeTimeline.TimelineWindowDefinition

- java.lang.Object
- - com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition

- Enclosing class:
    FakeTimeline

      public static final class FakeTimeline.TimelineWindowDefinition
      extends Object

  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 id

    - #### mediaItem

          public final MediaItem 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<AdPlaybackState> adPlaybackStates

  - ### Constructor Detail

    - #### TimelineWindowDefinition

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

    - #### 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:
        `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
          public 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

          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:
        `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 createPlaceholder​(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.