Retain playback position on re-preparation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736350
This commit is contained in:
andrewlewis 2017-10-19 06:34:02 -07:00 committed by Oliver Woodman
parent ce0a03dbdf
commit 006263e983

View File

@ -430,6 +430,10 @@ import java.io.IOException;
loadControl.onPrepared();
if (resetPosition) {
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;
mediaSource.prepareSource(player, true, this);