Expand description
Live screen-capture preview canvas (AUT-269).
Replaces the recorder’s mock display-preview with the real screen being
captured. Mirrors crate::camera_preview / crate::editor_preview_canvas:
an [Effect] starts/stops the downscaled preview capture as the display
section opens/closes (or the selected source changes), and a setInterval
poll paints the latest frame (latest_screen_frame_bgra) into the canvas.
The backend captures downscaled to 1280×720 (screen_capture::PREVIEW_WIDTH
/ PREVIEW_HEIGHT) and excludes the recorder’s own windows, so the poll is
cheap and the preview doesn’t capture itself (the screen-of-its-own-screen
feedback loop).
Constants§
- SCREEN_
PREVIEW_ CANVAS_ ID - Stable DOM id for the screen-preview
<canvas>(found by the poll). - SCREEN_
PREVIEW_ HEIGHT - Preview frame height — matches the backend
screen_capture::PREVIEW_HEIGHT. - SCREEN_
PREVIEW_ POLL_ MS - ~15 fps poll interval (ms) — matches the camera/editor previews.
- SCREEN_
PREVIEW_ WIDTH - Preview frame width — must match the backend
screen_capture::PREVIEW_WIDTHso the polled BGRA bytes fit the canvas pixel-for-pixel (putImageDatadoes not scale). The two crates can’t share a const (native vs wasm).
Functions§
- install_
screen_ preview - Native stub — the screen preview runs only in the wasm webview.