docs/doc/reference/com/google/android/exoplayer2/DefaultLoadControl.Builder.html
Package com.google.android.exoplayer2
Enclosing class:DefaultLoadControl
public static final classDefaultLoadControl.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Builder for DefaultLoadControl.
Constructors | Constructor | Description |
| --- | --- |
| Builder() |
Constructs a new instance.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| DefaultLoadControl | build() |
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 | setTargetBufferBytes(int targetBufferBytes) |
Sets the target buffer size in bytes.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Builder()
Constructs a new instance.
-
@CanIgnoreReturnValue
public[DefaultLoadControl.Builder](DefaultLoadControl.Builder.html "class in com.google.android.exoplayer2")setAllocator([DefaultAllocator](upstream/DefaultAllocator.html "class in com.google.android.exoplayer2.upstream")allocator)
Sets the DefaultAllocator used by the loader.
Parameters:allocator - The DefaultAllocator.Returns:This builder, for convenience.Throws:IllegalStateException - If build() has already been called.
-
@CanIgnoreReturnValue
public[DefaultLoadControl.Builder](DefaultLoadControl.Builder.html "class in com.google.android.exoplayer2")setBufferDurationsMs(int minBufferMs,
int maxBufferMs,
int bufferForPlaybackMs,
int bufferForPlaybackAfterRebufferMs)
Sets the buffer duration parameters.
Parameters: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.Returns:This builder, for convenience.Throws:IllegalStateException - If build() has already been called.
-
@CanIgnoreReturnValue
public[DefaultLoadControl.Builder](DefaultLoadControl.Builder.html "class in com.google.android.exoplayer2")setTargetBufferBytes(int targetBufferBytes)
Sets the target buffer size in bytes. If set to C.LENGTH_UNSET, the target buffer size will be calculated based on the selected tracks.
Parameters:targetBufferBytes - The target buffer size in bytes.Returns:This builder, for convenience.Throws:IllegalStateException - If build() has already been called.
-
@CanIgnoreReturnValue
public[DefaultLoadControl.Builder](DefaultLoadControl.Builder.html "class in com.google.android.exoplayer2")setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds)
Sets whether the load control prioritizes buffer time constraints over buffer size constraints.
Parameters:prioritizeTimeOverSizeThresholds - Whether the load control prioritizes buffer time constraints over buffer size constraints.Returns:This builder, for convenience.Throws:IllegalStateException - If build() has already been called.
-
@CanIgnoreReturnValue
public[DefaultLoadControl.Builder](DefaultLoadControl.Builder.html "class in com.google.android.exoplayer2")setBackBuffer(int backBufferDurationMs,
boolean retainBackBufferFromKeyframe)
Sets the back buffer duration, and whether the back buffer is retained from the previous keyframe.
Parameters:backBufferDurationMs - The back buffer duration in milliseconds.retainBackBufferFromKeyframe - Whether the back buffer is retained from the previous keyframe.Returns:This builder, for convenience.Throws:IllegalStateException - If build() has already been called.
-
public[DefaultLoadControl](DefaultLoadControl.html "class in com.google.android.exoplayer2")build()
Creates a DefaultLoadControl.