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.Windows.
  • Constructor Details

    • Builder

      public Builder()
      Creates a new Builder.
  • Method Details

    • durationUs

      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

      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

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

      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.