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
+4 -2
View File
@@ -227,8 +227,10 @@ export class AudioPlayer {
this.isPlaying = true;
this.isPaused = false;
// Resume from pause position
this.scheduler.playFromPosition(this.pausePosition);
// Resume from pause position. pausePosition is absolute track time;
// playFromPosition expects a buffer-relative position (excludes playbackOffset).
const bufferRelativePosition = this.pausePosition - this.scheduler.getPlaybackOffset();
this.scheduler.playFromPosition(Math.max(0, bufferRelativePosition));
this.startProgressTracking();
return { success: true };