mirror of
https://github.com/vector-im/element-call.git
synced 2026-11-10 01:02:27 +00:00
A lobby captures the microphone and the camera on the browser's devices alone, with `createLocalMedia`, so that any backend can take them over: `LocalMedia` hands out the same `LocalAudioMediaTrack` and `LocalVideoMediaTrack` a call renders, with mute, device and facing switches and the host's `VideoProcessor` run on the preview. Given to `join` as `publish`, the tracks are moved rather than shared: the publisher takes them over as it starts publishing, their lobby objects are finished, and the LiveKit backend adopts the device tracks as its own and the processor with its running output, so the join captures nothing and initialises nothing again. Also here, found on the way: a track already on the requested device is left alone (LiveKit would restart it, always on Firefox, which echoes no device id in `getConstraints()`), identical captures in flight are coalesced (React's strict mode mounts twice), and every operation on a processor takes its turn, since a stopped track tears its processor down without waiting for the next track's init. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>