-
public class LoadControlConfig.Builder
The LoadControlConfig Builder.
-
-
Field Summary
Fields Modifier and Type Field Description private int
minBufferMs
private int
maxBufferMs
private int
bufferForPlaybackMs
private int
bufferForPlaybackAfterRebufferMs
private int
targetBufferBytes
private boolean
prioritizeTimeOverSizeThresholds
private AllocatorConfig
allocatorConfig
-
Constructor Summary
Constructors Constructor Description LoadControlConfig.Builder()
Instantiates a new LoadControlConfig.Builder.
-
Method Summary
Modifier and Type Method Description LoadControlConfig.Builder
setMinBufferMs(int minBufferMs)
Sets the minimum duration of media that the player will attempt to ensure isbuffered at all times, in milliseconds. LoadControlConfig.Builder
setMaxBufferMs(int maxBufferMs)
Sets the maximum duration of media that the player will attempt buffer, inmilliseconds. LoadControlConfig.Builder
setBufferForPlaybackMs(int bufferForPlaybackMs)
Sets the duration of media that must be buffered for playback to start orresume following a user action such as a seek, in milliseconds. LoadControlConfig.Builder
setBufferForPlaybackAfterRebufferMs(int bufferForPlaybackAfterRebufferMs)
Sets the default duration of media that must be buffered forplayback to resume after a rebuffer, in milliseconds. LoadControlConfig.Builder
setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes. LoadControlConfig.Builder
setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer timeconstraints over buffer size constraints. LoadControlConfig.Builder
setAllocatorConfig(AllocatorConfig allocatorConfig)
Sets the AllocatorConfig. LoadControlConfig
build()
Builds the LoadControlConfig. -
-
Method Detail
-
setMinBufferMs
LoadControlConfig.Builder setMinBufferMs(int minBufferMs)
Sets the minimum duration of media that the player will attempt to ensure isbuffered at all times, in milliseconds.
- Parameters:
minBufferMs
- the min buffer in milliseconds
-
setMaxBufferMs
LoadControlConfig.Builder setMaxBufferMs(int maxBufferMs)
Sets the maximum duration of media that the player will attempt buffer, inmilliseconds.
- Parameters:
maxBufferMs
- the max buffer in milliseconds
-
setBufferForPlaybackMs
LoadControlConfig.Builder setBufferForPlaybackMs(int bufferForPlaybackMs)
Sets the duration of media that must be buffered for playback to start orresume following a user action such as a seek, in milliseconds.
- Parameters:
bufferForPlaybackMs
- the buffer for playback in milliseconds
-
setBufferForPlaybackAfterRebufferMs
LoadControlConfig.Builder setBufferForPlaybackAfterRebufferMs(int bufferForPlaybackAfterRebufferMs)
Sets the default duration of media that must be buffered forplayback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused bybuffer depletion rather than a user action.
- Parameters:
bufferForPlaybackAfterRebufferMs
- the buffer for playback after rebuffer ms
-
setTargetBufferBytes
LoadControlConfig.Builder setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes. If set to LENGTH_UNSET, thetarget buffer size will be calculated usingcom.google.android.exoplayer2.DefaultLoadControl.calculateTargetBufferBytes(Renderer[], ExoTrackSelection[]).
- Parameters:
targetBufferBytes
- the target buffer bytes
-
setPrioritizeTimeOverSizeThresholds
LoadControlConfig.Builder setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer timeconstraints over buffer size constraints.
- Parameters:
prioritizeTimeOverSizeThresholds
- the prioritize time over size thresholds
-
setAllocatorConfig
LoadControlConfig.Builder setAllocatorConfig(AllocatorConfig allocatorConfig)
Sets the AllocatorConfig. Note that the AllocatorConfig must not be null.
- Parameters:
allocatorConfig
- the allocator config
-
build
LoadControlConfig build()
Builds the LoadControlConfig.
-
-
-
-