mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-14 18:01:20 +08:00
c16e2dd9df
Reviewer feedback on PR #395: when composition hosts are present we now attach the MutationObserver only to those subtrees, so any `<audio data-start>` / `<video data-start>` injected at body level (or under a non-host wrapper) will silently never get a parent-frame proxy. Today no runtime path produces that shape, but if one ever does the failure mode is "audio just doesn't play" with no diagnostic trail. Add a forensic guard in `selectMediaObserverTargets`: when the scoped path is taken, walk the body for `[data-start]` audio/video that has no `[data-composition-id]` ancestor and emit a single `console.warn` with the orphan elements. The walk is cheap (one typed `querySelectorAll` + a `closest` per match) and only runs on the scoped branch, so the no-host fallback retains its legacy behavior with zero extra work. Tests cover the four meaningful states: scoped + body orphan (warn), scoped + media inside host (no warn), no-host fallback (no warn even with body media), and untimed body media (no warn). Made-with: Cursor