Package com.castlabs.android.player

# Class LowLatencyProfile

java.lang.Object
com.castlabs.android.player.LowLatencyProfile

public class LowLatencyProfile extends Object
Profile that groups all the relevant parameters related to low latency live streaming.

This profile can be applied to an existing Bundle or PlaybackState *before* passing it to `PlayerController.open(Bundle)`.

All the fields defined in this class will override the values from other configurations.

To get an instance use the `LowLatencyProfile.Builder`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `LowLatencyProfile.Builder`
  Builder class for creating LowLatencyProfile instances.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `CustomUtcTimingElement`
  `customUtcTimingElement`
  Will override `LiveConfiguration.customUtcTimingElement`
  `static final boolean`
  `DEFAULT_HLS_FORCE_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT`
  Default flag for forcing HLS playlist update target duration coefficient.
  `static final float`
  `DEFAULT_HLS_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT`
  Default HLS playlist update target duration coefficient.
  `static final int`
  `DEFAULT_LIVE_EDGE_LATENCY_MS`
  Default live edge latency in milliseconds.
  `static final int`
  `DEFAULT_MIN_PLAYBACK_START_MS`
  Default minimum playback start time in milliseconds.
  `static final int`
  `DEFAULT_MIN_REBUFFER_START_MS`
  Default minimum rebuffer start time in milliseconds.
  `static final CustomUtcTimingElement`
  `DEFAULT_UTC_TIMING_ELEMENT`
  Default UTC timing element for low latency streaming.
  `boolean`
  `hlsForcePlaylistUpdateTargetDuration`
  Will override `LiveConfiguration.hlsForcePlaylistUpdateTargetDuration`
  `float`
  `hlsPlaylistUpdateTargetDurationCoefficient`
  Will override `LiveConfiguration.hlsPlaylistUpdateTargetDurationCoefficient`
  `int`
  `liveEdgeLatencyMs`
  Will override `LiveConfiguration.liveEdgeLatencyMs`
  `int`
  `minPlaybackStartMs`
  Will override `BufferConfiguration.minPlaybackStartMs`
  `int`
  `minRebufferStartMs`
  Will override `BufferConfiguration.minRebufferStartMs`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LowLatencyProfile()`
  Create a new low latency profile with the default params
  `LowLatencyProfile(CustomUtcTimingElement customUtcTimingElement, int liveEdgeLatencyMs, float hlsPlaylistUpdateTargetDurationCoefficient, boolean hlsForcePlaylistUpdateTargetDuration, int minPlaybackStartMs, int minRebufferStartMs)`
  Create a low latency profile

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Bundle`
  `applyTo(Bundle bundle)`
  Apply the profile to the given Bundle
  `PlayerConfig`
  `applyTo(PlayerConfig playerConfig)`
  Apply the profile to the given PlaybackState
  `String`
  `toString()`

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

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

- ## Field Details

  - ### DEFAULT_UTC_TIMING_ELEMENT

    public static final CustomUtcTimingElement DEFAULT_UTC_TIMING_ELEMENT
    Default UTC timing element for low latency streaming.

  - ### DEFAULT_LIVE_EDGE_LATENCY_MS

    public static final int DEFAULT_LIVE_EDGE_LATENCY_MS
    Default live edge latency in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_MIN_PLAYBACK_START_MS

    public static final int DEFAULT_MIN_PLAYBACK_START_MS
    Default minimum playback start time in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_MIN_REBUFFER_START_MS

    public static final int DEFAULT_MIN_REBUFFER_START_MS
    Default minimum rebuffer start time in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_HLS_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT

    public static final float DEFAULT_HLS_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT
    Default HLS playlist update target duration coefficient.
    See Also:
      - Constant Field Values

  - ### DEFAULT_HLS_FORCE_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT

    public static final boolean DEFAULT_HLS_FORCE_PLAYLIST_UPDATE_TARGET_DURATION_COEFFICIENT
    Default flag for forcing HLS playlist update target duration coefficient.
    See Also:
      - Constant Field Values

  - ### customUtcTimingElement

    public CustomUtcTimingElement customUtcTimingElement
    Will override `LiveConfiguration.customUtcTimingElement`

  - ### liveEdgeLatencyMs

    public int liveEdgeLatencyMs
    Will override `LiveConfiguration.liveEdgeLatencyMs`

  - ### hlsPlaylistUpdateTargetDurationCoefficient

    public float hlsPlaylistUpdateTargetDurationCoefficient
    Will override `LiveConfiguration.hlsPlaylistUpdateTargetDurationCoefficient`

  - ### hlsForcePlaylistUpdateTargetDuration

    public boolean hlsForcePlaylistUpdateTargetDuration
    Will override `LiveConfiguration.hlsForcePlaylistUpdateTargetDuration`

  - ### minPlaybackStartMs

    public int minPlaybackStartMs
    Will override `BufferConfiguration.minPlaybackStartMs`

  - ### minRebufferStartMs

    public int minRebufferStartMs
    Will override `BufferConfiguration.minRebufferStartMs`

- ## Constructor Details

  - ### LowLatencyProfile

    public LowLatencyProfile()
    Create a new low latency profile with the default params

  - ### LowLatencyProfile

    public LowLatencyProfile(CustomUtcTimingElement customUtcTimingElement, int liveEdgeLatencyMs, float hlsPlaylistUpdateTargetDurationCoefficient, boolean hlsForcePlaylistUpdateTargetDuration, int minPlaybackStartMs, int minRebufferStartMs)
    Create a low latency profile
    Parameters:
      `customUtcTimingElement` - Custom UTCTiming element to use
      `liveEdgeLatencyMs` - Number of milliseconds that the playback should lag behind the live edge
      `hlsPlaylistUpdateTargetDurationCoefficient` - The target duration coefficient for playlist update interval.
      `hlsForcePlaylistUpdateTargetDuration` - Whether to force the target duration coefficient when defining the playlist update interval
      `minPlaybackStartMs` - The minimum duration of data that must be buffered for playback to start or resume following a user action such as a seek
      `minRebufferStartMs` - The minimum duration of data that must be buffered for playback to resume after a player invoked rebuffer

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### applyTo

    public Bundle applyTo(@NonNull Bundle bundle)
    Apply the profile to the given Bundle
    Parameters:
      `bundle` - Bundle where to get the current configuration
    Returns:
      a Bundle with the modified configuration

  - ### applyTo

    public PlayerConfig applyTo(@NonNull PlayerConfig playerConfig)
    Apply the profile to the given PlaybackState
    Parameters:
      `playerConfig` - where to get the current configuration
    Returns:
      a Playbackstate with the modified configuration