Package com.castlabs.android.player.models

# Class Timeline.Window.Builder

java.lang.Object
com.castlabs.android.player.models.Timeline.Window.Builder

Enclosing class:
  `Timeline.Window`

public static class Timeline.Window.Builder extends Object
Builder for `Timeline.Window`s.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Creates a new Builder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addPeriod(Timeline.Period period)`
  Adds a `Timeline.Period` to the Window.
  `Timeline.Window.Builder`
  `config(PlayerConfig tag)`
  Sets the `PlayerConfig` of the Window.
  `Timeline.Window.Builder`
  `defaultPositionUs(long defaultPositionUs)`
  Sets the default position relative to the start of the window at which to begin playback, in microseconds.
  `Timeline.Window.Builder`
  `durationUs(long durationUs)`
  Sets the duration of the Window in microseconds.
  `Timeline.Window.Builder`
  `dynamic(boolean dynamic)`
  Sets whether this is a dynamic (live) Window or not.
  `Timeline.Window`
  `get()`
  Builds the `Timeline.Window`.
  `Timeline.Window.Builder`
  `positionInFirstPeriodUs(long positionInFirstPeriodUs)`
  Sets the position of the Window relative to its first Period in microseconds.
  `Timeline.Window.Builder`
  `startTimeMs(long windowStartTimeMs)`
  Sets the start time of the Window in milliseconds.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Creates a new Builder.

- ## Method Details

  - ### durationUs

    @NonNull public Timeline.Window.Builder durationUs(long durationUs)
    Sets the duration of the Window in microseconds.
    Parameters:
      `durationUs` - the duration in microseconds
    Returns:
      this Builder

  - ### dynamic

    @NonNull public Timeline.Window.Builder dynamic(boolean dynamic)
    Sets whether this is a dynamic (live) Window or not.
    Parameters:
      `dynamic` - true if dynamic, false otherwise
    Returns:
      this Builder

  - ### positionInFirstPeriodUs

    @NonNull public Timeline.Window.Builder positionInFirstPeriodUs(long positionInFirstPeriodUs)
    Sets the position of the Window relative to its first Period in microseconds.
    Parameters:
      `positionInFirstPeriodUs` - the position in microseconds
    Returns:
      this Builder

  - ### defaultPositionUs

    @NonNull public Timeline.Window.Builder defaultPositionUs(long defaultPositionUs)
    Sets the default position relative to the start of the window at which to begin playback, in microseconds. May be `C.TIME_UNSET`.
    Parameters:
      `defaultPositionUs` - the position in microseconds
    Returns:
      this Builder

  - ### startTimeMs

    @NonNull public Timeline.Window.Builder startTimeMs(long windowStartTimeMs)
    Sets the start time of the Window in milliseconds.
    Parameters:
      `windowStartTimeMs` - The start time in milliseconds.
    Returns:
      This Builder.

  - ### get

    @NonNull public Timeline.Window get()
    Builds the `Timeline.Window`.
    Returns:
      the `Timeline.Window`

  - ### addPeriod

    public void addPeriod(@NonNull Timeline.Period period)
    Adds a `Timeline.Period` to the Window.
    Parameters:
      `period` - the `Timeline.Period` to add

  - ### config

    @NonNull public Timeline.Window.Builder config(@NonNull PlayerConfig tag)
    Sets the `PlayerConfig` of the Window.
    Parameters:
      `tag` - The `PlayerConfig`.
    Returns:
      This Builder.