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 theLiveConfiguration.Builderto create instances of this class.- Since:
- 4.1.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLiveConfiguration.Builder-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description longavailabilityStartTimeOffsetOverwriteMsOverwrite or set the availability start time offset for ultra low latency streams.CatchupConfigurationcatchupConfigurationDefines the catchup configurationstatic Parcelable.Creator<LiveConfiguration>CREATORCustomUtcTimingElementcustomUtcTimingElementCustom CustomUtcTimingElement.static longDEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITEstatic longDEFAULT_TIME_SYNC_SAFETY_MSbooleanhlsForcePlaylistUpdateTargetDurationWhether thehlsPlaylistUpdateTargetDurationCoefficientshould also be applied when the currently loaded manifest is renewed.inthlsLiveTailSegmentIndexDefines the HLS segment index counting from the tail from which the live playback should start.floathlsPlaylistUpdateTargetDurationCoefficientThe default coefficient applied to playlist update interval when calculating the playlist update interval.intliveEdgeLatencyMsDefines the number of milliseconds that the playback should lag behind the "live edge" (i.e.longminManifestUpdatePeriodMsBy default the manifest update period is defined by the manifest.intnotifyManifestIntervalMsSets the manifest notify interval in milliseconds.booleansnapToSegmentStartBy default the start position for a live stream snaps to a segment start.longtimesyncSafetyMsSet 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 valuesLiveConfiguration(CustomUtcTimingElement customUtcTimingElement, int liveEdgeLatencyMs, int hlsLiveTailSegmentIndex, float hlsPlaylistUpdateTargetDurationCoefficient, boolean hlsForcePlaylistUpdateTargetDuration, CatchupConfiguration catchupConfiguration, long minManifestUpdatePeriodMs, boolean snapToSegmentStart, long availabilityStartTimeOffsetOverwriteMs, long timesyncSafetyMs, int notifyManifestIntervalMs)Create a new live configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(LiveConfiguration source)Copies the values from the given live configuration to this configurationintdescribeContents()booleanequals(Object obj)inthashCode()StringtoString()voidwriteToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<LiveConfiguration> CREATOR
-
DEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITE
public static final long DEFAULT_AVAILABILITY_START_TIME_OFFSET_OVERWRITE
- See Also:
- Constant Field Values
-
DEFAULT_TIME_SYNC_SAFETY_MS
public static final long DEFAULT_TIME_SYNC_SAFETY_MS
- See Also:
- Constant Field Values
-
customUtcTimingElement
public CustomUtcTimingElement customUtcTimingElement
Custom CustomUtcTimingElement. This is used for live DASH content. If this is informed and forced withCustomUtcTimingElement.forceit will take prevalence over any otherUtcTimingElementpresent in the DASH manifest. Ifforceis 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_MSNote 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
hlsLiveTailSegmentIndexYou 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_VALUEas 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 to0. In case the value goes out of the segment size boundaries the very first segment counting from the segments head is used.The
liveEdgeLatencyMsfield 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 alsohlsForcePlaylistUpdateTargetDuration
-
hlsForcePlaylistUpdateTargetDuration
public boolean hlsForcePlaylistUpdateTargetDuration
Whether thehlsPlaylistUpdateTargetDurationCoefficientshould also be applied when the currently loaded manifest is renewed.
-
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.
-
-
Constructor Detail
-
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, @Nullable CatchupConfiguration catchupConfiguration, long minManifestUpdatePeriodMs, boolean snapToSegmentStart, long availabilityStartTimeOffsetOverwriteMs, long timesyncSafetyMs, int notifyManifestIntervalMs)
Create a new live configuration- Parameters:
customUtcTimingElement- A CustomUTCTimingElementliveEdgeLatencyMs- Number of milliseconds that the playback should lag behind the live edgehlsLiveTailSegmentIndex- The HLS live tail segment indexhlsPlaylistUpdateTargetDurationCoefficient- The target duration coefficient for playlist update interval.hlsForcePlaylistUpdateTargetDuration- Whether to force the target duration coefficient when defining the playlist update intervalcatchupConfiguration- Playback catchup configurationminManifestUpdatePeriodMs- Force the update period for live streams or set it toC.TIME_UNSETto use the value define in the manifest (default)snapToSegmentStart- Set this to false to allow starting live streams in the middle of a segmentavailabilityStartTimeOffsetOverwriteMs- Set or overwrite the availability start time offset. Set toC.TIME_UNSETto use the default from the manifesttimesyncSafetyMs- Set the time sync safety to cope with inaccurate time syncsnotifyManifestIntervalMs- Set the manifest notify interval in milliseconds. Only for DASH.
-
-
Method Detail
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
apply
public void apply(LiveConfiguration source)
Copies the values from the given live configuration to this configuration- Parameters:
source- the source
-
-