Skip to content

Add startTime to gotoTrack for atomic seek-on-goto - #26

Merged
switz merged 2 commits into
masterfrom
add-start-time-to-goto
Sep 19, 2026
Merged

switz merged 2 commits into
masterfrom
add-start-time-to-goto

Conversation

@switz

@switz switz commented Sep 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds optional startTime parameter to gotoTrack(index, playImmediately, startTime) and the GOTO event
  • Renames seekCurrentToZero → seekCurrentToStartTime, which reads startTime from the event (defaults to 0)
  • The seek is now atomic with the goto transition — no separate pendingSeekTime needed

Test plan

  • All 348 existing tests pass
  • Verify gotoTrack(2, true, 30) starts track 2 at 30s
  • Verify gotoTrack(2, false) still seeks to 0 (backward compat)
  • Verify gotoTrack(2, true, 0) behaves identically to gotoTrack(2, true)

🤖 Generated with Claude Code

gotoTrack(index, playImmediately, startTime) now seeks to startTime
(default 0) as part of the GOTO transition, eliminating the need for
a separate pendingSeekTime mechanism.

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:18:03.935906Z a9b880c PR opened
🔒 Security Review ✅ Completed 2026-09-19T18:19:01.131000Z a9b880c 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

cloudflare-workers-and-pages Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Deploying gapless with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7027a98
Status: ✅  Deploy successful!
Preview URL: https://2d8794a1.gapless-e1l.pages.dev
Branch Preview URL: https://add-start-time-to-goto.gapless-e1l.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9b880cc33

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

'cancelAllGapless',
'gotoTrackIndex',
'seekCurrentToZero',
'seekCurrentToStartTime',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the start time before immediate playback

When playImmediately is true, every guarded GOTO branch calls activateAndPlayCurrent without calling seekCurrentToStartTime; the new seek action is only present in the non-immediate fallback branches. Consequently, gotoTrack(2, true, 30) starts track 2 at its existing/default position rather than at 30 seconds. Add the seek after gotoTrackIndex and before activateAndPlayCurrent in each play-immediately branch.

Useful? React with 👍 / 👎.

The play-immediate GOTO branches were missing seekCurrentToStartTime,
so gotoTrack(index, true, startTime) would ignore the startTime. Add
the seek after gotoTrackIndex and before activateAndPlayCurrent in all
four state branches (idle, playing, paused, ended).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@switz
switz merged commit bda72c9 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