Skip to content

fix(player/runtime): rebind timelines and bound paused seeks - #3489

Open
vanceingalls wants to merge 7 commits into
vance/captions-convergence-02-runtime-errorsfrom
vance/captions-convergence-03-direct-timeline-rebind
Open

fix(player/runtime): rebind timelines and bound paused seeks#3489
vanceingalls wants to merge 7 commits into
vance/captions-convergence-02-runtime-errorsfrom
vance/captions-convergence-03-direct-timeline-rebind

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Part 3 of 3 in the HyperFrames caption convergence stack. Depends on #3472.

What changes

  • Re-probes the same-origin direct timeline before player operations (legacy/fallback path).
  • Reconciles the injected core runtime timeline after a runtime-data handler replaces it.
  • Publishes the reconciled timeline and duration before runtime-data-applied, so an immediate seek cannot clamp against the initial timeline.
  • Defers initial iframe navigation and option-driven reloads until the custom element is connected.
  • Preserves runtime-bridge readiness across the iframe load that follows the runtime ready message.
  • Adds an HTTP(S)-validated runtime-src override for pairing a branch-tip player with its matching branch-tip core in an authorized local rig; unsafe schemes fall back to the pinned CDN runtime.
  • Preserves playhead/rate/visibility across timeline replacement, clears stale state on removal, and keeps runtime-data failures observable.

Why

Data-driven caption attach rebuilds the GSAP timeline. The direct player adapter and the injected runtime could retain the killed initial object, leaving playback on segment one. Real-browser validation exposed three additional ordering hazards: React can assign srcdoc before connection, the runtime ready message can precede iframe load, and a replacement could be acknowledged before its new duration was published.

Verification

  • HyperFrames core: 124 test files / 2,542 tests passed; focused runtime tests, typecheck, build, oxlint, and oxfmt passed.

  • Player: 12 test files / 360 tests passed; build, typecheck, oxlint, and oxfmt passed.

  • Historical exact-browser proof against catalog 0.6.0 and the matching branch-tip core: create with React's srcdoc then runtime-src ordering; apply three segments; switch caption-highlight to caption-pill-karaoke; immediately seek to 0.2s, 1.7s, and 3.2s after each apply. Both styles reported duration 3.9s and landed all seeks exactly; the old player disconnected, the bridge stayed ready, and no runtime-data error fired.

  • Current-head CI, Windows rendering, player performance, preview regression, CodeQL, and all nine regression shards are green.

Review size

390 additions and 9 deletions across 5 files, below the 1,500-line stack limit.

@vanceingalls

Copy link
Copy Markdown
Collaborator Author

@claude review

@vanceingalls vanceingalls changed the title fix(player): rebind replaced direct timelines fix(player/runtime): rebind replaced timelines after runtime data Aug 26, 2026
@vanceingalls

Copy link
Copy Markdown
Collaborator Author

@claude review

@vanceingalls

Copy link
Copy Markdown
Collaborator Author

Post-push verification update:

  • CI, regression, and Windows render verification all passed on 587e392f0 (runs 32915077051, 32915077042, 32915077056).
  • The earlier cancelled workflow rows are superseded-run history, not failures.
  • Local core/player suites and retained-channel browser proof are documented in the PR body.

No code changes are pending; awaiting the fresh review approval.

@vanceingalls

Copy link
Copy Markdown
Collaborator Author

@claude review

Please review final head 1b7e265, especially pre-connect attribute ordering, bridge readiness across iframe load, and timeline publication before runtime-data-applied.

@miga-heygen
miga-heygen force-pushed the vance/captions-convergence-03-direct-timeline-rebind branch from 1b7e265 to 87a62ea Compare August 26, 2026 07:48
@vanceingalls vanceingalls changed the title fix(player/runtime): rebind replaced timelines after runtime data fix(player/runtime): rebind timelines and bound paused seeks Aug 26, 2026
@vanceingalls

Copy link
Copy Markdown
Collaborator Author

CPU-stability update at c89f5d71c:

  • The sandbox transport no longer calls full GSAP totalTime(...) on every animation frame while paused. It still seeks while playing, after an explicit paused seek/timeline replacement, and once after a manual gesture.
  • Six-player isolated measurement: 5,004 paused totalTime calls in 2s before; 30 initialization calls followed by zero additional calls over 3s after (~99.4% fewer full seeks).
  • Focused core runtime verification passes 94/94, runtime typecheck passes, and the loopback runtime was rebuilt from this exact head.
  • No behavior-specific caption code was added; this fixes the reusable HyperFrames transport loop.

@claude review

@vanceingalls

Copy link
Copy Markdown
Collaborator Author

Final-head automation update for c89f5d71c:

  • Main CI passed on attempt 3 of run 33004020080; attempts 1–2 only exceeded the checkout step's one-minute job timeout before the file-size script ran.
  • Replacement nine-shard regression run 33004020095 passed.
  • The inherited fix(player): report and fail closed on runtime delivery errors #3472 shard-8 timeout also passed on rerun 32944541371.
  • gh pr checks now reports no failing or pending current check contexts. The old failed regression row in the raw rollup is superseded history.

The remaining gate is human review.

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