I am using exoplayer 2.11.8
version. In this version, they have changed the lot of methods. By Searching their docs, I build the Exoplayer
.
Here's the Code:
DataSource.Factory dataSourceFactory =
new DefaultHttpDataSourceFactory(Util.getUserAgent(this
, getApplicationInfo().loadLabel(getPackageManager()).toString()));
LoadControl loadControl = new DefaultLoadControl.Builder()
.setAllocator(new DefaultAllocator(true, 16))
.setBufferDurationsMs(MIN_BUFFER_DURATION,
MAX_BUFFER_DURATION,
MIN_PLAYBACK_START_BUFFER,
MIN_PLAYBACK_RESUME_BUFFER)
.setTargetBufferBytes(-1)
.setPrioritizeTimeOverSizeThresholds(true).createDefaultLoadControl();
// Create a progressive media source pointing to a stream uri.
MediaSource mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(audio_url));
// Create a player instance.
simpleExoPlayer = new SimpleExoPlayer.Builder(this).build();
I want to pass the load control
to exoplayer. In older versions, Load control
was passed like below,
TrackSelector trackSelector = new DefaultTrackSelector();
DefaultLoadControl loadControl = new DefaultLoadControl.Builder().setBufferDurationsMs(32*1024, 64*1024, 1024, 1024).createDefaultLoadControl();
player = ExoPlayerFactory.newSimpleInstance(this, trackSelector, loadControl);
In newer version, they have changed the code for creating exoplayer instance which is shown below
simpleExoPlayer = new SimpleExoPlayer.Builder(this).build();
In here, i don't know where to pass the load control
. I searched their exoplayer
docs. But there is no example for passing load control
.
Please help me and provide some solution to pass load control
to exoplayer