Class CatchupConfiguration.Builder

java.lang.Object
com.castlabs.android.player.CatchupConfiguration.Builder
Enclosing class:
CatchupConfiguration

public static class CatchupConfiguration.Builder extends Object
Builder for a CatchupConfiguration.
  • Constructor Details

  • Method Details

    • none

      Configure the none catchup mode
      Returns:
      The builder
    • speed

      public CatchupConfiguration.Builder speed(long lowerTimeThresholdMs, long upperTimeThresholdMs, long fallbackTimeThresholdMs, float speedCoefficient)
      Configure the catchup mode with CatchupConfiguration.Type.SPEED. The thresholds specified here will be relative to either the buffer health or the media end.

      Both "lower" and "upper" thresholds must be greater than 0 and lowerTimeThresholdMs must be lower than upperTimeThresholdMs

      Parameters:
      lowerTimeThresholdMs - The lower threshold in ms to set speed to 1f, when 0 the speed up will stop at live edge
      upperTimeThresholdMs - The upper threshold in ms to start catchup
      fallbackTimeThresholdMs - The threshold which the player won't allow to go beyond. Seek operations will be used to snap the player to this threshold. Specify 0 to disable.
      speedCoefficient - The speed used when doing catchup, larger or equal to 1f
      Returns:
      The builder
    • seek

      public CatchupConfiguration.Builder seek(long lowerTimeThresholdMs, long upperTimeThresholdMs)
      Configure the catchup mode with CatchupConfiguration.Type.SEEK. The thresholds specified here will be relative to either the buffer health or the media end.

      Both params must be greater than 0 and lowerTimeThresholdMs must be lower than upperTimeThresholdMs

      Parameters:
      lowerTimeThresholdMs - Threshold to which the seek operation will be triggered to
      upperTimeThresholdMs - The seek operation will be triggered whenever this threshold is reached
      Returns:
      The builder
    • shouldSeekOnDownloadError

      public CatchupConfiguration.Builder shouldSeekOnDownloadError(Boolean seekOnDownloadError)
      Parameters:
      seekOnDownloadError - Whether the Catchup Config Manager should seek to the Upper Threshold when a Segment Download Error is seen.
      Returns:
      The builder
    • get

      public CatchupConfiguration get()
      Builds the instance
      Returns:
      an instance of CatchupConfiguration