mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Retain playback position on re-preparation
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=172736350
This commit is contained in:
parent
ce0a03dbdf
commit
006263e983
1 changed files with 4 additions and 0 deletions
|
|
@ -430,6 +430,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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue