/** * WebRTC local loopback sender for the camera bubble overlay. * * Replaces the canvas-encode-and-emit pipeline in `bubble-pump.ts` with a * direct `RTCPeerConnection` hand-off. The popover holds the camera * `MediaStream` (because of WebKit's single-page capture-exclusion policy — * see the long comment in `recorder.ts`) and adds the video track to a * peer connection. The bubble window creates a receiving peer and gets * the track via `ontrack`. Signaling shuttles through Tauri events. * * Why this exists: * * - `canvas.toDataURL` on the main thread was ~30-40ms per frame on * macOS WKWebView during recording. At any FPS higher than ~6 we * dropped frames. Dropping to 6 FPS + 112px + JPEG q=0.45 made the * bubble both choppy AND fuzzy. * - WebRTC goes through WebKit's native media pipeline. Video track → * SDP negotiation → receiver gets a live track → `