fix: convert absolute pause position to buffer-relative on resume after seek-beyond-buffer

This commit is contained in:
daniel-c-harvey
2026-06-07 16:55:31 -04:00
parent 40e001cc7a
commit 7cd85f0bb1
2 changed files with 7 additions and 3 deletions
@@ -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;