Package com.castlabs.android.player.models

# Class Timeline.Period.Builder

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

Enclosing class:
  `Timeline.Period`

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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Timeline.Period.Builder`
  `addAudioTrack(AudioTrack audioTrack)`
  Adds an `AudioTrack` to the Period.
  `Timeline.Period.Builder`
  `addDateRanges(List<HlsDateRange> dateRanges)`
  Adds a List of `HlsDateRange`s to the Period.
  `Timeline.Period.Builder`
  `addDescriptor(DashDescriptor descriptor)`
  Adds a `DashDescriptor` to the Period.
  `Timeline.Period.Builder`
  `addDescriptors(Collection<? extends DashDescriptor> descriptors)`
  Adds a Collection of `DashDescriptor`s to the Period.
  `Timeline.Period.Builder`
  `addEventStreams(Collection<? extends EventStream> eventStreams)`
  Adds a Collection of `EventStream`s to the Period.
  `Timeline.Period.Builder`
  `addSubtitleTrack(SubtitleTrack subtitleTrack)`
  Adds a `SubtitleTrack` to the Period.
  `Timeline.Period.Builder`
  `addVideoTrack(VideoTrack videoTrack)`
  Adds a `VideoTrack` to the Period.
  `Timeline.Period.Builder`
  `durationUs(long durationUs)`
  Sets the duration of the Period in microseconds.
  `Timeline.Period`
  `get()`
  Builds the `Timeline.Period`.
  `Timeline.Period.Builder`
  `id(Object id)`
  Sets the id of the Period.
  `Timeline.Period.Builder`
  `positionInWindowUs(long positionInWindowUs)`
  Sets the position of the Period inside its Window in microseconds.
  `Timeline.Period.Builder`
  `windowIndex(int windowIndex)`
  Sets the Window index to which this Period belongs to.

  ### 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

  - ### addVideoTrack

    public Timeline.Period.Builder addVideoTrack(VideoTrack videoTrack)
    Adds a `VideoTrack` to the Period.
    Parameters:
      `videoTrack` - the `VideoTrack` to add
    Returns:
      this Builder

  - ### addAudioTrack

    public Timeline.Period.Builder addAudioTrack(AudioTrack audioTrack)
    Adds an `AudioTrack` to the Period.
    Parameters:
      `audioTrack` - the `AudioTrack` to add
    Returns:
      this Builder

  - ### addSubtitleTrack

    public Timeline.Period.Builder addSubtitleTrack(SubtitleTrack subtitleTrack)
    Adds a `SubtitleTrack` to the Period.
    Parameters:
      `subtitleTrack` - the `SubtitleTrack` to add
    Returns:
      this Builder

  - ### addDescriptor

    public Timeline.Period.Builder addDescriptor(DashDescriptor descriptor)
    Adds a `DashDescriptor` to the Period.
    Parameters:
      `descriptor` - the `DashDescriptor` to add
    Returns:
      this Builder

  - ### id

    public Timeline.Period.Builder id(Object id)
    Sets the id of the Period.
    Parameters:
      `id` - the id of the Period
    Returns:
      this Builder

  - ### get

    public Timeline.Period get()
    Builds the `Timeline.Period`.
    Returns:
      the `Timeline.Period`

  - ### windowIndex

    public Timeline.Period.Builder windowIndex(int windowIndex)
    Sets the Window index to which this Period belongs to.
    Parameters:
      `windowIndex` - the Window index
    Returns:
      this Builder

  - ### addDescriptors

    public Timeline.Period.Builder addDescriptors(Collection<? extends DashDescriptor> descriptors)
    Adds a Collection of `DashDescriptor`s to the Period.
    Parameters:
      `descriptors` - the Collection of `DashDescriptor`s to add
    Returns:
      this Builder

  - ### durationUs

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

  - ### positionInWindowUs

    public Timeline.Period.Builder positionInWindowUs(long positionInWindowUs)
    Sets the position of the Period inside its Window in microseconds.
    Parameters:
      `positionInWindowUs` - the position in microseconds
    Returns:
      this Builder

  - ### addEventStreams

    public Timeline.Period.Builder addEventStreams(Collection<? extends EventStream> eventStreams)
    Adds a Collection of `EventStream`s to the Period.
    Parameters:
      `eventStreams` - the Collection of `EventStream`s to add
    Returns:
      this Builder

  - ### addDateRanges

    @NonNull public Timeline.Period.Builder addDateRanges(@NonNull List<HlsDateRange> dateRanges)
    Adds a List of `HlsDateRange`s to the Period.
    Parameters:
      `dateRanges` - The list of `HlsDateRange`s to add.
    Returns:
      This Builder.