Merge pull request #3469 from ByteHamster/buffer-rewind
Keep buffer depending on rewind time
This commit is contained in:
commit
338c68ff44
|
@ -26,6 +26,7 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
|
||||||
|
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
|
@ -63,7 +64,7 @@ public class ExoPlayerWrapper implements IPlayer {
|
||||||
loadControl.setBufferDurationsMs(30000, 120000,
|
loadControl.setBufferDurationsMs(30000, 120000,
|
||||||
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS,
|
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS,
|
||||||
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS);
|
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS);
|
||||||
loadControl.setBackBuffer(30000, true);
|
loadControl.setBackBuffer(UserPreferences.getRewindSecs() * 1000 + 500, true);
|
||||||
SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(mContext, new DefaultRenderersFactory(mContext),
|
SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(mContext, new DefaultRenderersFactory(mContext),
|
||||||
new DefaultTrackSelector(), loadControl.createDefaultLoadControl());
|
new DefaultTrackSelector(), loadControl.createDefaultLoadControl());
|
||||||
p.setSeekParameters(SeekParameters.PREVIOUS_SYNC);
|
p.setSeekParameters(SeekParameters.PREVIOUS_SYNC);
|
||||||
|
|
Loading…
Reference in New Issue