public static final class DefaultLoadControl.Builder
extends java.lang.Object
DefaultLoadControl
.Constructor and Description |
---|
Builder()
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
DefaultLoadControl |
createDefaultLoadControl()
Creates a
DefaultLoadControl . |
DefaultLoadControl.Builder |
setAllocator(DefaultAllocator allocator)
Sets the
DefaultAllocator used by the loader. |
DefaultLoadControl.Builder |
setBackBuffer(int backBufferDurationMs,
boolean retainBackBufferFromKeyframe)
Sets the back buffer duration, and whether the back buffer is retained from the previous
keyframe.
|
DefaultLoadControl.Builder |
setBufferDurationsMs(int minBufferMs,
int maxBufferMs,
int bufferForPlaybackMs,
int bufferForPlaybackAfterRebufferMs)
Sets the buffer duration parameters.
|
DefaultLoadControl.Builder |
setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer time constraints over buffer size
constraints.
|
DefaultLoadControl.Builder |
setPriorityTaskManager(PriorityTaskManager priorityTaskManager)
Sets the
PriorityTaskManager to use. |
DefaultLoadControl.Builder |
setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes.
|
public DefaultLoadControl.Builder setAllocator(DefaultAllocator allocator)
DefaultAllocator
used by the loader.allocator
- The DefaultAllocator
.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl.Builder setBufferDurationsMs(int minBufferMs, int maxBufferMs, int bufferForPlaybackMs, int bufferForPlaybackAfterRebufferMs)
minBufferMs
- The minimum duration of media that the player will attempt to ensure is
buffered at all times, in milliseconds.maxBufferMs
- The maximum duration of media that the player will attempt to buffer, in
milliseconds.bufferForPlaybackMs
- 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
- 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.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl.Builder setTargetBufferBytes(int targetBufferBytes)
C.LENGTH_UNSET
, the target buffer
size will be calculated based on the selected tracks.targetBufferBytes
- The target buffer size in bytes.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl.Builder setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
prioritizeTimeOverSizeThresholds
- Whether the load control prioritizes buffer time
constraints over buffer size constraints.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl.Builder setPriorityTaskManager(PriorityTaskManager priorityTaskManager)
PriorityTaskManager
to use.priorityTaskManager
- The PriorityTaskManager
to use.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl.Builder setBackBuffer(int backBufferDurationMs, boolean retainBackBufferFromKeyframe)
backBufferDurationMs
- The back buffer duration in milliseconds.retainBackBufferFromKeyframe
- Whether the back buffer is retained from the previous
keyframe.java.lang.IllegalStateException
- If createDefaultLoadControl()
has already been called.public DefaultLoadControl createDefaultLoadControl()
DefaultLoadControl
.