sw-local-camera
sw-local-camera
sw-local-camera
Aspect-ratio-aware preview tile for the local camera, with a “camera off” placeholder when video is muted or the stream is missing.
Designed for small picture-in-picture-style previews — typically slotted
into <sw-ui-call-layout>’s floating-video slot or used standalone in
a settings panel. The element reads getSettings() on the active video
track to detect the natural orientation (landscape, portrait, or square)
and rewrites --sw-local-camera-aspect so its container hugs the track.
Input precedence (most specific wins): .stream / .videoMuted >
.call > context. Any of .stream and .videoMuted can be set
independently — for example, you can supply an explicit stream from a
“join” preview screen while still letting videoMuted come from
devicesContext.
The mirror attribute reflects to the host so it can be styled with
:host([mirror]) and is the natural default for selfie cameras.
Class: SwLocalCamera · Module: packages/web-components/src/components/sw-local-camera.ts
SwLocalCamera, sw-local-cameraExplicit stream — highest precedence.
Explicit muted flag — overrides devicesContext.videoMuted.
Explicit Call — used when .stream is not set. Bypasses context.
mirror field.