Package com.castlabs.android.player
Class CatchupConfiguration.Builder
java.lang.Object
com.castlabs.android.player.CatchupConfiguration.Builder
- Enclosing class:
CatchupConfiguration
Builder for a
CatchupConfiguration
.-
Constructor Summary
ConstructorDescriptionCreate a new builder starting with the value from the given configurationBuilder
(CatchupConfiguration.TimeReference timeReference) Create a new builder with default values -
Method Summary
Modifier and TypeMethodDescriptionget()
Builds the instancenone()
Configure the none catchup modeseek
(long lowerTimeThresholdMs, long upperTimeThresholdMs) Configure the catchup mode withCatchupConfiguration.Type.SEEK
.shouldSeekOnDownloadError
(Boolean seekOnDownloadError) speed
(long lowerTimeThresholdMs, long upperTimeThresholdMs, long fallbackTimeThresholdMs, float speedCoefficient) Configure the catchup mode withCatchupConfiguration.Type.SPEED
.
-
Constructor Details
-
Builder
Create a new builder with default values- Parameters:
timeReference
- whichCatchupConfiguration.TimeReference
to use.
-
Builder
Create a new builder starting with the value from the given configuration- Parameters:
cfg
- The configuration
-
-
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 withCatchupConfiguration.Type.SPEED
. The thresholds specified here will be relative to either thebuffer health
or themedia 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, when0
the speed up will stop at live edgeupperTimeThresholdMs
- The upper threshold in ms to start catchupfallbackTimeThresholdMs
- 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 to1f
- Returns:
- The builder
-
seek
Configure the catchup mode withCatchupConfiguration.Type.SEEK
. The thresholds specified here will be relative to either thebuffer health
or themedia 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 toupperTimeThresholdMs
- The seek operation will be triggered whenever this threshold is reached- Returns:
- The builder
-
shouldSeekOnDownloadError
- Parameters:
seekOnDownloadError
- Whether the Catchup Config Manager should seek to the Upper Threshold when a Segment Download Error is seen.- Returns:
- The builder
-
get
Builds the instance- Returns:
- an instance of CatchupConfiguration
-