fix(playback): run embedded MPV position poll outside the Angular zone

With provideZoneChangeDetection a zone-registered interval runs app-wide
change detection every 500 ms for the entire stream. Register the drift
poll via NgZone.runOutsideAngular and never re-enter the zone — the drift
path is rAF → setEmbeddedMpvBounds IPC and touches no Angular state.
Frame-copy sessions skip the measurement entirely: the canvas is laid out
by the DOM and moves with the layout, so only the native-view child
window can go stale on a position-only shift.

Addresses the Codex P2 review finding on #1476.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 committed 2026-08-24 10:31:11 +02:00
1 parent 6c440fc437
commit 52e6471a0a
3 files changed
+109 -9

No files matched your search

+7 -1
View File
@@ -675,7 +675,13 @@ stale coordinates and rendered offset from the DOM stage. The session
controller therefore polls the host bounds every 500 ms while a session is
active, compares them against the last synced bounds with a half-pixel
tolerance, and schedules a re-sync only on drift — idle cost is one
`getBoundingClientRect` per tick with no IPC.
`getBoundingClientRect` per tick with no IPC. The interval is registered
outside Angular's zone (a zone timer would run app-wide change detection
every tick for the whole stream) and never re-enters it, because the drift
path is rAF → `setEmbeddedMpvBounds` IPC and touches no Angular state.
Frame-copy skips the measurement entirely: its canvas is laid out by the
DOM and moves with the layout, so only the native-view child window can go
stale on a position-only shift.
### Controls ownership by engine