Files
Vance Ingalls c16e2dd9df perf(player): warn when scoped observer skips body-level timed media
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
2026-04-22 16:28:57 -07:00
..
2026-04-22 17:28:11 -04:00
2026-04-22 17:28:11 -04:00
2026-04-22 17:28:11 -04:00