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 aCatchupConfiguration
.
-
-
Constructor Summary
Constructors Constructor Description Builder(CatchupConfiguration cfg)
Create a new builder starting with the value from the given configurationBuilder(CatchupConfiguration.TimeReference timeReference)
Create a new builder with default values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CatchupConfiguration
get()
Builds the instanceCatchupConfiguration.Builder
none()
Configure the none catchup modeCatchupConfiguration.Builder
seek(long lowerTimeThresholdMs, long upperTimeThresholdMs)
Configure the catchup mode withCatchupConfiguration.Type.SEEK
.CatchupConfiguration.Builder
speed(long lowerTimeThresholdMs, long upperTimeThresholdMs, long fallbackTimeThresholdMs, float speedCoefficient)
Configure the catchup mode withCatchupConfiguration.Type.SPEED
.
-
-
-
Constructor Detail
-
Builder
public Builder(@NonNull CatchupConfiguration.TimeReference timeReference)
Create a new builder with default values- Parameters:
timeReference
- whichCatchupConfiguration.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 Detail
-
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 withCatchupConfiguration.Type.SPEED
. The thresholds specified here will be relative to either thebuffer health
or themedia end
.- 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
public CatchupConfiguration.Builder seek(long lowerTimeThresholdMs, long upperTimeThresholdMs)
Configure the catchup mode withCatchupConfiguration.Type.SEEK
. The thresholds specified here will be relative to either thebuffer health
or themedia end
.- 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
-
get
public CatchupConfiguration get()
Builds the instance- Returns:
- an instance of CatchupConfiguration
-
-