DefaultLoadControl.Builder


class DefaultLoadControl.Builder


Builder for DefaultLoadControl.

Summary

Public constructors

Constructs a new instance.

Public functions

DefaultLoadControl!

Creates a DefaultLoadControl.

DefaultLoadControl.Builder!

Sets the DefaultAllocator used by the loader.

DefaultLoadControl.Builder!
@CanIgnoreReturnValue
setBackBuffer(
    backBufferDurationMs: Int,
    retainBackBufferFromKeyframe: Boolean
)

Sets the back buffer duration, and whether the back buffer is retained from the previous keyframe.

DefaultLoadControl.Builder!
@CanIgnoreReturnValue
setBufferDurationsMs(
    minBufferMs: Int,
    maxBufferMs: Int,
    bufferForPlaybackMs: Int,
    bufferForPlaybackAfterRebufferMs: Int
)

Sets the buffer duration parameters.

DefaultLoadControl.Builder!
@CanIgnoreReturnValue
setPrioritizeTimeOverSizeThresholds(
    prioritizeTimeOverSizeThresholds: Boolean
)

Sets whether the load control prioritizes buffer time constraints over buffer size constraints.

DefaultLoadControl.Builder!

Sets the target buffer size in bytes for each player.

Public constructors

Builder

Builder()

Constructs a new instance.

Public functions

build

fun build(): DefaultLoadControl!

Creates a DefaultLoadControl.

setAllocator

@CanIgnoreReturnValue
fun setAllocator(allocator: DefaultAllocator!): DefaultLoadControl.Builder!

Sets the DefaultAllocator used by the loader.

Parameters
allocator: DefaultAllocator!

The DefaultAllocator.

Returns
DefaultLoadControl.Builder!

This builder, for convenience.

Throws
java.lang.IllegalStateException

If build has already been called.

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 build has already been called.

setBufferDurationsMs

@CanIgnoreReturnValue
fun setBufferDurationsMs(
    minBufferMs: Int,
    maxBufferMs: Int,
    bufferForPlaybackMs: Int,
    bufferForPlaybackAfterRebufferMs: Int
): DefaultLoadControl.Builder!

Sets the buffer duration parameters.

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 build has already been called.

setPrioritizeTimeOverSizeThresholds

@CanIgnoreReturnValue
fun setPrioritizeTimeOverSizeThresholds(
    prioritizeTimeOverSizeThresholds: Boolean
): DefaultLoadControl.Builder!

Sets whether the load control prioritizes buffer time constraints over buffer size constraints.

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 build has already been called.

setTargetBufferBytes

@CanIgnoreReturnValue
fun setTargetBufferBytes(targetBufferBytes: Int): DefaultLoadControl.Builder!

Sets the target buffer size in bytes for each player. The actual overall target buffer size is this value multiplied by the number of players that use the load control simultaneously. If set to LENGTH_UNSET, the target buffer size of a player will be calculated based on the selected tracks of the player.

Parameters
targetBufferBytes: Int

The target buffer size in bytes.

Returns
DefaultLoadControl.Builder!

This builder, for convenience.

Throws
java.lang.IllegalStateException

If build has already been called.