Package com.castlabs.android.player

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

  Constructors
  Constructor
  Description
  `Builder(CatchupConfiguration cfg)`
  Create a new builder starting with the value from the given configuration
  `Builder(CatchupConfiguration.TimeReference timeReference)`
  Create a new builder with default values

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CatchupConfiguration`
  `get()`
  Builds the instance
  `CatchupConfiguration.Builder`
  `none()`
  Configure the none catchup mode
  `CatchupConfiguration.Builder`
  `seek(long lowerTimeThresholdMs, long upperTimeThresholdMs)`
  Configure the catchup mode with `CatchupConfiguration.Type.SEEK`.
  `CatchupConfiguration.Builder`
  `shouldSeekOnDownloadError(Boolean seekOnDownloadError)`
  `CatchupConfiguration.Builder`
  `speed(long lowerTimeThresholdMs, long upperTimeThresholdMs, long fallbackTimeThresholdMs, float speedCoefficient)`
  Configure the catchup mode with `CatchupConfiguration.Type.SPEED`.

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

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

- ## Constructor Details

  - ### Builder

    public Builder(@NonNull CatchupConfiguration.TimeReference timeReference)
    Create a new builder with default values
    Parameters:
      `timeReference` - which `CatchupConfiguration.TimeReference` to use.

  - ### Builder

    public Builder(CatchupConfiguration cfg)
    Create a new builder starting with the value from the given configuration
    Parameters:
      `cfg` - The configuration

- ## Method Details

  - ### none

    public CatchupConfiguration.Builder 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