Commit 08706f9b by andrewlewis Committed by Oliver Woodman

Retain playback position on re-preparation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736350
parent d09f8721
...@@ -443,6 +443,10 @@ import java.io.IOException; ...@@ -443,6 +443,10 @@ import java.io.IOException;
loadControl.onPrepared(); loadControl.onPrepared();
if (resetPosition) { if (resetPosition) {
playbackInfo = new PlaybackInfo(0, C.TIME_UNSET); playbackInfo = new PlaybackInfo(0, C.TIME_UNSET);
} else {
// The new start position is the current playback position.
playbackInfo = new PlaybackInfo(playbackInfo.periodId, playbackInfo.positionUs,
playbackInfo.contentPositionUs);
} }
this.mediaSource = mediaSource; this.mediaSource = mediaSource;
mediaSource.prepareSource(player, true, this); mediaSource.prepareSource(player, true, this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment