Skip to content

Most visited

Recently visited

navigation

BufferingParams.Builder

public static class BufferingParams.Builder
extends Object

java.lang.Object
   ↳ android.media.BufferingParams.Builder


Builder class for BufferingParams objects.

Here is an example where Builder is used to define the BufferingParams to be used by a MediaPlayer instance:

 BufferingParams myParams = mediaplayer.getDefaultBufferingParams();
 myParams = new BufferingParams.Builder(myParams)
             .setInitialBufferingWatermarkMs(10000)
             .build();
 mediaplayer.setBufferingParams(myParams);
 

Summary

Public constructors

BufferingParams.Builder()

Constructs a new Builder with the defaults.

BufferingParams.Builder(BufferingParams bp)

Constructs a new Builder from a given BufferingParams instance

Public methods

BufferingParams build()

Combines all of the fields that have been set and return a new BufferingParams object.

BufferingParams.Builder setInitialBufferingMode(int mode)

Sets the initial buffering mode.

BufferingParams.Builder setInitialBufferingWatermarkKB(int watermarkKB)

Sets the size based watermark in kilobytes for initial buffering.

BufferingParams.Builder setInitialBufferingWatermarkMs(int watermarkMs)

Sets the time based watermark in milliseconds for initial buffering.

BufferingParams.Builder setRebufferingMode(int mode)

Sets the rebuffering mode.

BufferingParams.Builder setRebufferingWatermarkHighKB(int watermarkKB)

Sets the size based high watermark in milliseconds for rebuffering.

BufferingParams.Builder setRebufferingWatermarkHighMs(int watermarkMs)

Sets the time based high watermark in milliseconds for rebuffering.

BufferingParams.Builder setRebufferingWatermarkLowKB(int watermarkKB)

Sets the size based low watermark in milliseconds for rebuffering.

BufferingParams.Builder setRebufferingWatermarkLowMs(int watermarkMs)

Sets the time based low watermark in milliseconds for rebuffering.

BufferingParams.Builder setRebufferingWatermarksKB(int lowWatermarkKB, int highWatermarkKB)

Sets the size based low and high watermarks in kilobytes for rebuffering.

BufferingParams.Builder setRebufferingWatermarksMs(int lowWatermarkMs, int highWatermarkMs)

Sets the time based low and high watermarks in milliseconds for rebuffering.

Inherited methods

From class java.lang.Object

Public constructors

BufferingParams.Builder

BufferingParams.Builder ()

Constructs a new Builder with the defaults. By default, both initial buffering mode and rebuffering mode are BUFFERING_MODE_NONE, and all watermarks are -1.

BufferingParams.Builder

BufferingParams.Builder (BufferingParams bp)

Constructs a new Builder from a given BufferingParams instance

Parameters
bp BufferingParams: the BufferingParams object whose data will be reused in the new Builder.

Public methods

build

BufferingParams build ()

Combines all of the fields that have been set and return a new BufferingParams object. IllegalStateException will be thrown if there is conflict between fields.

Returns
BufferingParams a new BufferingParams object

setInitialBufferingMode

BufferingParams.Builder setInitialBufferingMode (int mode)

Sets the initial buffering mode.

Parameters
mode int: one of BUFFERING_MODE_NONE, BUFFERING_MODE_TIME_ONLY, BUFFERING_MODE_SIZE_ONLY, BUFFERING_MODE_TIME_THEN_SIZE,
Returns
BufferingParams.Builder the same Builder instance.

setInitialBufferingWatermarkKB

BufferingParams.Builder setInitialBufferingWatermarkKB (int watermarkKB)

Sets the size based watermark in kilobytes for initial buffering.

Parameters
watermarkKB int: size based watermark in kilobytes
Returns
BufferingParams.Builder the same Builder instance.

setInitialBufferingWatermarkMs

BufferingParams.Builder setInitialBufferingWatermarkMs (int watermarkMs)

Sets the time based watermark in milliseconds for initial buffering.

Parameters
watermarkMs int: time based watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingMode

BufferingParams.Builder setRebufferingMode (int mode)

Sets the rebuffering mode.

Parameters
mode int: one of BUFFERING_MODE_NONE, BUFFERING_MODE_TIME_ONLY, BUFFERING_MODE_SIZE_ONLY, BUFFERING_MODE_TIME_THEN_SIZE,
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarkHighKB

BufferingParams.Builder setRebufferingWatermarkHighKB (int watermarkKB)

Sets the size based high watermark in milliseconds for rebuffering.

Parameters
watermarkKB int: size based high watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarkHighMs

BufferingParams.Builder setRebufferingWatermarkHighMs (int watermarkMs)

Sets the time based high watermark in milliseconds for rebuffering.

Parameters
watermarkMs int: time based high watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarkLowKB

BufferingParams.Builder setRebufferingWatermarkLowKB (int watermarkKB)

Sets the size based low watermark in milliseconds for rebuffering.

Parameters
watermarkKB int: size based low watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarkLowMs

BufferingParams.Builder setRebufferingWatermarkLowMs (int watermarkMs)

Sets the time based low watermark in milliseconds for rebuffering.

Parameters
watermarkMs int: time based low watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarksKB

BufferingParams.Builder setRebufferingWatermarksKB (int lowWatermarkKB, 
                int highWatermarkKB)

Sets the size based low and high watermarks in kilobytes for rebuffering.

Parameters
lowWatermarkKB int: size based low watermark in kilobytes
highWatermarkKB int: size based high watermark in kilobytes
Returns
BufferingParams.Builder the same Builder instance.

setRebufferingWatermarksMs

BufferingParams.Builder setRebufferingWatermarksMs (int lowWatermarkMs, 
                int highWatermarkMs)

Sets the time based low and high watermarks in milliseconds for rebuffering.

Parameters
lowWatermarkMs int: time based low watermark in milliseconds
highWatermarkMs int: time based high watermark in milliseconds
Returns
BufferingParams.Builder the same Builder instance.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.