Package com.brightcove.player.config
Class LoadControlConfig.Builder
- java.lang.Object
-
- com.brightcove.player.config.LoadControlConfig.Builder
-
- Enclosing class:
- LoadControlConfig
public static class LoadControlConfig.Builder extends java.lang.Object
The LoadControlConfig Builder.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Instantiates a new LoadControlConfig.Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadControlConfig
build()
Builds the LoadControlConfig.LoadControlConfig.Builder
setAllocatorConfig(AllocatorConfig allocatorConfig)
Sets theAllocatorConfig
.LoadControlConfig.Builder
setBufferForPlaybackAfterRebufferMs(int bufferForPlaybackAfterRebufferMs)
Sets the default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds.LoadControlConfig.Builder
setBufferForPlaybackMs(int bufferForPlaybackMs)
Sets the duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds.LoadControlConfig.Builder
setMaxBufferMs(int maxBufferMs)
Sets the maximum duration of media that the player will attempt buffer, in milliseconds.LoadControlConfig.Builder
setMinBufferMs(int minBufferMs)
Sets the minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds.LoadControlConfig.Builder
setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer time constraints over buffer size constraints.LoadControlConfig.Builder
setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes.
-
-
-
Method Detail
-
setMinBufferMs
public LoadControlConfig.Builder setMinBufferMs(int minBufferMs)
Sets the minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds.- Parameters:
minBufferMs
- the min buffer in milliseconds- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setMaxBufferMs
public LoadControlConfig.Builder setMaxBufferMs(int maxBufferMs)
Sets the maximum duration of media that the player will attempt buffer, in milliseconds.- Parameters:
maxBufferMs
- the max buffer in milliseconds- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setBufferForPlaybackMs
public LoadControlConfig.Builder setBufferForPlaybackMs(int bufferForPlaybackMs)
Sets the duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds.- Parameters:
bufferForPlaybackMs
- the buffer for playback in milliseconds- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setBufferForPlaybackAfterRebufferMs
public LoadControlConfig.Builder setBufferForPlaybackAfterRebufferMs(int bufferForPlaybackAfterRebufferMs)
Sets 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.- Parameters:
bufferForPlaybackAfterRebufferMs
- the buffer for playback after rebuffer ms- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setTargetBufferBytes
public LoadControlConfig.Builder setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes. If set toC.LENGTH_UNSET
, the target buffer size will be calculated usingcom.google.android.exoplayer2.DefaultLoadControl#calculateTargetBufferSize(Renderer[], TrackSelectionArray)
.- Parameters:
targetBufferBytes
- the target buffer bytes- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setPrioritizeTimeOverSizeThresholds
public LoadControlConfig.Builder setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer time constraints over buffer size constraints.- Parameters:
prioritizeTimeOverSizeThresholds
- the prioritize time over size thresholds- Returns:
- the builder instance
- See Also:
DefaultLoadControl
-
setAllocatorConfig
public LoadControlConfig.Builder setAllocatorConfig(AllocatorConfig allocatorConfig)
Sets theAllocatorConfig
. Note that the AllocatorConfig must not be null.- Parameters:
allocatorConfig
- the allocator config- Returns:
- the builder instance
- See Also:
AllocatorConfig
-
build
public LoadControlConfig build()
Builds the LoadControlConfig.
-
-