fix: convert absolute pause position to buffer-relative on resume after seek-beyond-buffer
This commit is contained in:
@@ -235,7 +235,9 @@ export class PlaybackScheduler {
|
||||
const position = this.getCurrentPosition();
|
||||
this.isActive_ = false; // Prevent handleSourceEnded from scheduling more
|
||||
this.stopAllSources();
|
||||
this.playbackAnchorPosition = position;
|
||||
// getCurrentPosition() returns absolute time (anchor + playbackOffset); the anchor
|
||||
// is buffer-relative, so strip the offset back out before storing it.
|
||||
this.playbackAnchorPosition = position - this.playbackOffset;
|
||||
this.playbackAnchorTime = 0;
|
||||
this.nextScheduleTime = 0;
|
||||
return position;
|
||||
|
||||
Reference in New Issue
Block a user