The MediaPlayer provides methods to set and get the buffer control parameters.
If you do not set the buffer control parameters before beginning playback, the media player defaults to 2 seconds for the initial buffer and 30 seconds for the buffer time.
These methods throw an IllegalArgumentException if the parameters are not valid, such as when:
void setBufferControlParameters(BufferControlParameters params)
BufferControlParameters getBufferControlParameters()
If the AVE cannot set the specified values, the media player enters the ERROR state. The error code is SET_BUFFER_PARAMETERS_ERROR.
For example, to set the initial buffer to 5 seconds and the buffer time to 30 seconds:
mediaPlayer.setBufferControlParameters(BufferControlParameters.createDual(5000, 30000));
The PMPDemoApp demonstrates this feature; use the application’s settings to set the buffer values.