Package com.castlabs.android.player

# Class LiveConfiguration

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

All Implemented Interfaces:
  `Parcelable`

public class LiveConfiguration extends Object implements Parcelable
Configuration object that groups all relevant parameters related to live streaming. Use the `LiveConfiguration.Builder` to create instances of this class.

Since:
  4.1.10

- ## Nested Class Summary

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

  ## Nested classes/interfaces inherited from interface android.os.Parcelable

  `Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `long`
  `availabilityStartTimeOffsetOverwriteMs`
  Overwrite or set the availability start time offset for ultra low latency streams.
  `CatchupConfiguration`
  `catchupConfiguration`
  Defines the catchup configuration
  `static final Parcelable.Creator<LiveConfiguration>`
  `CREATOR`
  Creator for Parcelable implementation.
  `CustomUtcTimingElement`
  `customUtcTimingElement`
  Custom CustomUtcTimingElement.
  `long`
  `dashMinLiveStartPositionUs`
  The minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.
  `static final long`
  `DEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITE`
  Default value for availability start time offset overwrite.
  `static final long`
  `DEFAULT_TIME_SYNC_SAFETY_MS`
  Default value for time synchronization safety buffer.
  `boolean`
  `hlsForcePlaylistUpdateTargetDuration`
  Whether the `hlsPlaylistUpdateTargetDurationCoefficient` should also be applied when the currently loaded manifest is renewed.
  `int`
  `hlsLiveTailSegmentIndex`
  Defines the HLS segment index counting from the tail from which the live playback should start.
  `float`
  `hlsPlaylistUpdateTargetDurationCoefficient`
  The default coefficient applied to playlist update interval when calculating the playlist update interval.
  `int`
  `liveEdgeLatencyMs`
  Defines the number of milliseconds that the playback should lag behind the "live edge" (i.e.
  `long`
  `minManifestUpdatePeriodMs`
  By default the manifest update period is defined by the manifest.
  `int`
  `notifyManifestIntervalMs`
  Sets the manifest notify interval in milliseconds.
  `boolean`
  `preferLatencyOverBufferSafety`
  If set to true, will seek on Live Content to drop startup buffers to be closer to the Live Edge.
  `boolean`
  `snapToSegmentStart`
  By default the start position for a live stream snaps to a segment start.
  `long`
  `timesyncSafetyMs`
  Set the time synchronization safety buffer to cope with inaccuracies

  ### Fields inherited from interface android.os.Parcelable

  `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LiveConfiguration()`
  Create a new live configuration using the default values
  `LiveConfiguration(CustomUtcTimingElement customUtcTimingElement, int liveEdgeLatencyMs, int hlsLiveTailSegmentIndex, float hlsPlaylistUpdateTargetDurationCoefficient, boolean hlsForcePlaylistUpdateTargetDuration, long dashMinLiveStartPositionUs, CatchupConfiguration catchupConfiguration, long minManifestUpdatePeriodMs, boolean snapToSegmentStart, long availabilityStartTimeOffsetOverwriteMs, long timesyncSafetyMs, int notifyManifestIntervalMs, boolean preferLatencyOverBufferSafety)`
  Create a new live configuration

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `apply(LiveConfiguration source)`
  Copies the values from the given live configuration to this configuration
  `int`
  `describeContents()`
  `boolean`
  `equals(Object obj)`
  `int`
  `hashCode()`
  `String`
  `toString()`
  `void`
  `writeToParcel(Parcel dest, int flags)`

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

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### CREATOR

    public static final Parcelable.Creator<LiveConfiguration> CREATOR
    Creator for Parcelable implementation.

  - ### DEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITE

    public static final long DEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITE
    Default value for availability start time offset overwrite. When set to this value, the manifest's default will be used.
    See Also:
      - Constant Field Values

  - ### DEFAULT_TIME_SYNC_SAFETY_MS

    public static final long DEFAULT_TIME_SYNC_SAFETY_MS
    Default value for time synchronization safety buffer. When set to this value, no additional safety buffer is added.
    See Also:
      - Constant Field Values

  - ### customUtcTimingElement

    public CustomUtcTimingElement customUtcTimingElement
    Custom CustomUtcTimingElement. This is used for live DASH content. If this is informed and forced with `CustomUtcTimingElement.force` it will take prevalence over any other `UtcTimingElement` present in the DASH manifest. If `force` is false, it will be used as a fallback.

  - ### liveEdgeLatencyMs

    public int liveEdgeLatencyMs
    Defines the number of milliseconds that the playback should lag behind the "live edge" (i.e. the end of the most recently defined media in the manifest). Choosing a small value will minimize latency introduced by the player. Hence a small value may increase the probability of rebuffering and playback failures.

    When the key is not set then the manifest specified value is used or otherwise the default value `SdkConsts.DEFAULT_LIVE_EDGE_LATENCY_MS`

    Note that this parameter can also be used to start the live stream at a different position! For example, if you have an event stream with a large seek window and you do not want to start at the live edge but further behind, use this parameter to specify how much behind the live edge you want to start.

    This value is also used for HLS live content. In case it is informed, it will override the HLS-specific setting `hlsLiveTailSegmentIndex`

    You can use the same parameter also to start playback at the beginning of the seek window rather than the live edge. For that, put `Integer.MAX_VALUE` as the value.

  - ### hlsLiveTailSegmentIndex

    public int hlsLiveTailSegmentIndex
    Defines the HLS segment index counting from the tail from which the live playback should start. Should be larger or equal to `0`. In case the value goes out of the segment size boundaries the very first segment counting from the segments head is used.

    The `liveEdgeLatencyMs` field will prevail if it informed.

  - ### hlsPlaylistUpdateTargetDurationCoefficient

    public float hlsPlaylistUpdateTargetDurationCoefficient
    The default coefficient applied to playlist update interval when calculating the playlist update interval. Applied when the currently loaded playlist is not renewed. see also `hlsForcePlaylistUpdateTargetDuration`

  - ### hlsForcePlaylistUpdateTargetDuration

    public boolean hlsForcePlaylistUpdateTargetDuration
    Whether the `hlsPlaylistUpdateTargetDurationCoefficient` should also be applied when the currently loaded manifest is renewed.

  - ### dashMinLiveStartPositionUs

    public long dashMinLiveStartPositionUs
    The minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.

    This value will override any suggested value from the manifest and helps to prevent `BehindLiveWindowException` issues.

  - ### catchupConfiguration

    @Nullable public CatchupConfiguration catchupConfiguration
    Defines the catchup configuration

  - ### minManifestUpdatePeriodMs

    public long minManifestUpdatePeriodMs
    By default the manifest update period is defined by the manifest. This configuration option can be used to overwrite the manifest setting and force a specific update period.

  - ### snapToSegmentStart

    public boolean snapToSegmentStart
    By default the start position for a live stream snaps to a segment start. Set this to false to allow starting a live stream in the middle of a segment. This is mostly relevant for ultra low latency live streams.

  - ### availabilityStartTimeOffsetOverwriteMs

    public long availabilityStartTimeOffsetOverwriteMs
    Overwrite or set the availability start time offset for ultra low latency streams.

  - ### timesyncSafetyMs

    public long timesyncSafetyMs
    Set the time synchronization safety buffer to cope with inaccuracies

  - ### notifyManifestIntervalMs

    public int notifyManifestIntervalMs
    Sets the manifest notify interval in milliseconds. This only applies for implicit live DASH manifests. Represents the time in between internal Timeline representation updates when manifest updates are not required. Can be particularly helpful for low latency streams. Default is 5000 ms.

  - ### preferLatencyOverBufferSafety

    public boolean preferLatencyOverBufferSafety
    If set to true, will seek on Live Content to drop startup buffers to be closer to the Live Edge.

- ## Constructor Details

  - ### LiveConfiguration

    public LiveConfiguration()
    Create a new live configuration using the default values

  - ### LiveConfiguration

    public LiveConfiguration(CustomUtcTimingElement customUtcTimingElement, int liveEdgeLatencyMs, int hlsLiveTailSegmentIndex, float hlsPlaylistUpdateTargetDurationCoefficient, boolean hlsForcePlaylistUpdateTargetDuration, long dashMinLiveStartPositionUs, @Nullable CatchupConfiguration catchupConfiguration, long minManifestUpdatePeriodMs, boolean snapToSegmentStart, long availabilityStartTimeOffsetOverwriteMs, long timesyncSafetyMs, int notifyManifestIntervalMs, boolean preferLatencyOverBufferSafety)
    Create a new live configuration
    Parameters:
      `customUtcTimingElement` - A CustomUTCTimingElement
      `liveEdgeLatencyMs` - Number of milliseconds that the playback should lag behind the live edge
      `hlsLiveTailSegmentIndex` - The HLS live tail segment index
      `hlsPlaylistUpdateTargetDurationCoefficient` - The target duration coefficient for playlist update interval.
      `hlsForcePlaylistUpdateTargetDuration` - Whether to force the target duration coefficient when defining the playlist update interval
      `dashMinLiveStartPositionUs` - The minimum position to start playback from in a live stream, in microseconds relative to the start of the live window
      `catchupConfiguration` - Playback catchup configuration
      `minManifestUpdatePeriodMs` - Force the update period for live streams or set it to `C.TIME_UNSET` to use the value define in the manifest (default)
      `snapToSegmentStart` - Set this to false to allow starting live streams in the middle of a segment
      `availabilityStartTimeOffsetOverwriteMs` - Set or overwrite the availability start time offset. Set to `C.TIME_UNSET` to use the default from the manifest
      `timesyncSafetyMs` - Set the time sync safety to cope with inaccurate time syncs
      `notifyManifestIntervalMs` - Set the manifest notify interval in milliseconds. Only for DASH.
      `preferLatencyOverBufferSafety` - If true, will seek on Live Content to drop startup buffers to be closer to the Live Edge

- ## Method Details

  - ### describeContents

    public int describeContents()
    Specified by:
      `describeContents` in interface `Parcelable`

  - ### toString

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

  - ### writeToParcel

    public void writeToParcel(Parcel dest, int flags)
    Specified by:
      `writeToParcel` in interface `Parcelable`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### apply

    public void apply(LiveConfiguration source)
    Copies the values from the given live configuration to this configuration
    Parameters:
      `source` - the source