Skip to content

Fix crossover using stale HTML5 currentTime after seek-before-load - #27

Merged
switz merged 1 commit into
masterfrom
fix/crossover-seek-offset
Sep 19, 2026
Merged

switz merged 1 commit into
masterfrom
fix/crossover-seek-offset

Conversation

@switz

@switz switz commented Sep 19, 2026

Copy link
Copy Markdown
Member

Summary

  • When gotoTrack(idx, false, 31.5) sets pausedAtTrackTime before the HTML5 element finishes loading, _crossoverHtml5ToWebAudio was overwriting it with audio.currentTime (~1.3s), causing the WebAudio source to start from the wrong offset.
  • Now prefers pausedAtTrackTime over audio.currentTime when the seek position hasn't been reflected in the HTML5 element yet.
  • Adds a regression test that verifies the crossover starts at the seek position, not the stale HTML5 time.

Test plan

  • Existing crossover tests pass (vitest run tests/unit/crossover-flow.test.ts — 10/10)
  • New test: crossover preserves pausedAtTrackTime when HTML5 element has not caught up to a prior seek

🤖 Generated with Claude Code

When gotoTrack set pausedAtTrackTime before the HTML5 element finished
loading, the crossover would overwrite it with audio.currentTime (~1.3s)
instead of preserving the correct seek position (e.g. 31.5s). Now
_crossoverHtml5ToWebAudio prefers pausedAtTrackTime when it exceeds
audio.currentTime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-19T18:48:57.605347Z 41da099 PR opened
🔒 Security Review ✅ Completed 2026-09-19T18:48:08.278335Z 41da099 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gapless with  Cloudflare Pages  Cloudflare Pages

Latest commit: 41da099
Status: ✅  Deploy successful!
Preview URL: https://0ed6e79d.gapless-e1l.pages.dev
Branch Preview URL: https://fix-crossover-seek-offset.gapless-e1l.pages.dev

View logs

@switz
switz merged commit 5a8efc3 into master Sep 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant