DefaultLoadControl.Builder
class DefaultLoadControl.Builder
Builder for DefaultLoadControl.
Summary
Public constructors |
|---|
Builder()Constructs a new instance. |
Public functions |
|
|---|---|
DefaultLoadControl! |
build()Creates a |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the back buffer duration, and whether the back buffer is retained from the previous keyframe. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the buffer duration parameters for both streaming and local on-device playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the buffer duration parameters for local on-device playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the buffer duration parameters for streaming playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the target buffer size in bytes for a player with the specified |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets whether the load control prioritizes buffer time constraints over buffer size constraints for streaming and local on-device playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets whether the load control prioritizes buffer time constraints over buffer size constraints for local on-device playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets whether the load control prioritizes buffer time constraints over buffer size constraints for streaming playback. |
DefaultLoadControl.Builder! |
@CanIgnoreReturnValueSets the target buffer size in bytes for each player. |
Public constructors
Public functions
setAllocator
@CanIgnoreReturnValue
fun setAllocator(allocator: DefaultAllocator!): DefaultLoadControl.Builder!
Sets the DefaultAllocator used by the loader.
| Parameters | |
|---|---|
allocator: DefaultAllocator! |
The |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setBackBuffer
@CanIgnoreReturnValue
fun setBackBuffer(
backBufferDurationMs: Int,
retainBackBufferFromKeyframe: Boolean
): DefaultLoadControl.Builder!
Sets the back buffer duration, and whether the back buffer is retained from the previous keyframe.
| Parameters | |
|---|---|
backBufferDurationMs: Int |
The back buffer duration in milliseconds. |
retainBackBufferFromKeyframe: Boolean |
Whether the back buffer is retained from the previous keyframe. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setBufferDurationsMs
@CanIgnoreReturnValue
fun setBufferDurationsMs(
minBufferMs: Int,
maxBufferMs: Int,
bufferForPlaybackMs: Int,
bufferForPlaybackAfterRebufferMs: Int
): DefaultLoadControl.Builder!
Sets the buffer duration parameters for both streaming and local on-device playback.
Use setBufferDurationsMsForStreaming or setBufferDurationsMsForLocalPlayback to set them separately for each use case.
| Parameters | |
|---|---|
minBufferMs: Int |
The minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. |
maxBufferMs: Int |
The maximum duration of media that the player will attempt to buffer, in milliseconds. |
bufferForPlaybackMs: Int |
The duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds. |
bufferForPlaybackAfterRebufferMs: Int |
The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setBufferDurationsMsForLocalPlayback
@CanIgnoreReturnValue
fun setBufferDurationsMsForLocalPlayback(
minBufferMs: Int,
maxBufferMs: Int,
bufferForPlaybackMs: Int,
bufferForPlaybackAfterRebufferMs: Int
): DefaultLoadControl.Builder!
Sets the buffer duration parameters for local on-device playback.
Playbacks are considered to be on-device if the uri has an empty scheme or one of the schemes in LOCAL_PLAYBACK_SCHEMES.
| Parameters | |
|---|---|
minBufferMs: Int |
The minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. |
maxBufferMs: Int |
The maximum duration of media that the player will attempt to buffer, in milliseconds. |
bufferForPlaybackMs: Int |
The duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds. |
bufferForPlaybackAfterRebufferMs: Int |
The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setBufferDurationsMsForStreaming
@CanIgnoreReturnValue
fun setBufferDurationsMsForStreaming(
minBufferMs: Int,
maxBufferMs: Int,
bufferForPlaybackMs: Int,
bufferForPlaybackAfterRebufferMs: Int
): DefaultLoadControl.Builder!
Sets the buffer duration parameters for streaming playback.
Playbacks are considered to be streaming if the uri is none of the schemes in LOCAL_PLAYBACK_SCHEMES.
| Parameters | |
|---|---|
minBufferMs: Int |
The minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. |
maxBufferMs: Int |
The maximum duration of media that the player will attempt to buffer, in milliseconds. |
bufferForPlaybackMs: Int |
The duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds. |
bufferForPlaybackAfterRebufferMs: Int |
The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setPlayerTargetBufferBytes
@CanIgnoreReturnValue
fun setPlayerTargetBufferBytes(
playerName: String!,
playerTargetBufferBytes: Int
): DefaultLoadControl.Builder!
Sets the target buffer size in bytes for a player with the specified playerName. When not set or set to LENGTH_UNSET, the target buffer size of a player will be the value set via setTargetBufferBytes if it is not LENGTH_UNSET, otherwise it will be calculated based on the selected tracks of the player.
For the PRELOAD with PlayerId.PRELOAD.name, the default target buffer bytes is DEFAULT_TARGET_BUFFER_BYTES_FOR_PRELOAD.
| Parameters | |
|---|---|
playerName: String! |
The name of the player. The same name must be set to the player via |
playerTargetBufferBytes: Int |
The target buffer size in bytes for the specified player. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setPrioritizeTimeOverSizeThresholds
@CanIgnoreReturnValue
fun setPrioritizeTimeOverSizeThresholds(
prioritizeTimeOverSizeThresholds: Boolean
): DefaultLoadControl.Builder!
Sets whether the load control prioritizes buffer time constraints over buffer size constraints for streaming and local on-device playback.
Use setPrioritizeTimeOverSizeThresholdsForStreaming or setPrioritizeTimeOverSizeThresholdsForLocalPlayback to set them separately for each use case.
| Parameters | |
|---|---|
prioritizeTimeOverSizeThresholds: Boolean |
Whether the load control prioritizes buffer time constraints over buffer size constraints. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setPrioritizeTimeOverSizeThresholdsForLocalPlayback
@CanIgnoreReturnValue
fun setPrioritizeTimeOverSizeThresholdsForLocalPlayback(
prioritizeTimeOverSizeThresholds: Boolean
): DefaultLoadControl.Builder!
Sets whether the load control prioritizes buffer time constraints over buffer size constraints for local on-device playback.
Playbacks are considered to be on-device if the uri has an empty scheme or one of the schemes in LOCAL_PLAYBACK_SCHEMES.
| Parameters | |
|---|---|
prioritizeTimeOverSizeThresholds: Boolean |
Whether the load control prioritizes buffer time constraints over buffer size constraints. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setPrioritizeTimeOverSizeThresholdsForStreaming
@CanIgnoreReturnValue
fun setPrioritizeTimeOverSizeThresholdsForStreaming(
prioritizeTimeOverSizeThresholds: Boolean
): DefaultLoadControl.Builder!
Sets whether the load control prioritizes buffer time constraints over buffer size constraints for streaming playback.
Playbacks are considered to be streaming if the uri is none of the schemes in LOCAL_PLAYBACK_SCHEMES.
| Parameters | |
|---|---|
prioritizeTimeOverSizeThresholds: Boolean |
Whether the load control prioritizes buffer time constraints over buffer size constraints. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
setTargetBufferBytes
@CanIgnoreReturnValue
fun setTargetBufferBytes(targetBufferBytes: Int): DefaultLoadControl.Builder!
Sets the target buffer size in bytes for each player. If set to LENGTH_UNSET, the target buffer size of a player will be calculated based on the selected tracks of the player.
This value will be ignored for the players with a playerName that has target buffer size set via setPlayerTargetBufferBytes.
| Parameters | |
|---|---|
targetBufferBytes: Int |
The target buffer size in bytes. |
| Returns | |
|---|---|
DefaultLoadControl.Builder! |
This builder, for convenience. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |