Skip to content

fix(core,producer): stamp render ids on empty-src media and pair the snapshot by them - #3513

Open
valeriangalliat wants to merge 1 commit into
heygen-com:mainfrom
valeriangalliat:patch/runtime-src-duplicate-ids
Open

fix(core,producer): stamp render ids on empty-src media and pair the snapshot by them#3513
valeriangalliat wants to merge 1 commit into
heygen-com:mainfrom
valeriangalliat:patch/runtime-src-duplicate-ids

Conversation

@valeriangalliat

@valeriangalliat valeriangalliat commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Empty-src <video> / <audio> now get a document-unique data-hf-render-id, and the browser snapshot / visibility / volume probes key and look up by that id instead of the author id.

Fixes #3512.

Why

#3342 stamped render ids only when a playable source was already on the element. Authors who assign el.src = url in the scene script leave src="" in markup. The static parse skips those elements, so their clips exist only in the browser snapshot. That snapshot still keyed by author id. After inline, two scenes sharing id="clip" collapse onto one window: the first scene plays the second scene's footage, the second scene paints blank. Preview is fine because each scene's script is scoped.

Duplicate ids across nested compositions are legal per file. check does not flag them.

How

  • assignMediaRenderIds stamps every video / audio (and img[src]), including empty src. Author ids are still not rewritten.
  • discoverMediaFromBrowser reports data-hf-render-id when present.
  • Visibility sampling uses the same id. Volume automation resolves through __hfMediaEl (already installed on the probe page) with getElementById as fallback.

Test plan

  • Unit tests added/updated
  • Manual testing performed against the public repro
  • Documentation updated (if applicable)

New tests

  • mediaRenderIds.test.ts: colliding src="" videos get clip / clip__hf2; no-src and empty <source> child are stamped too.
  • htmlCompiler.test.ts: snapshot reports colliding empty-src videos by render id; compileForRender of two empty-src scenes stamps unique render ids (static list still empty).

Reproduction: https://github.com/ArcadeHQ/hyperframes-repros/tree/patch/runtime-src-duplicate-ids

On main, scene A at t≈2s shows ~42 (scene B's window) and scene B at t≈6s is blank. After this change both should match preview (~12 and ~46).

…snapshot by them

Residual of heygen-com#3340: runtime-assigned src is skipped by the static parse, so
the browser snapshot was still keying clips by author id. Colliding scenes
collapsed onto one window.
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.

Nested compositions that reuse a video id with runtime-assigned src collapse onto one scene in the export

1 participant