For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReferenceClick-to-Call
GuidesReferenceClick-to-Call
  • Core
    • Overview
  • Entities
    • SignalWire
    • Address
    • Participant
    • ClientPreferences
    • SelfCapabilities
    • SelfParticipant
    • User
    • WebRTCCall
  • Web Components
    • Overview
    • sw-audio-level
    • sw-call-controls
    • sw-call-dialpad
    • sw-call-media
    • sw-call-provider
    • sw-call-status
    • sw-call-widget
    • sw-click-to-call
    • sw-device-selector
    • sw-directory
    • sw-local-camera
    • sw-participant-controls
    • sw-participants
    • sw-self-media
    • sw-ui-alert
    • sw-ui-background
    • sw-ui-call-layout
    • sw-ui-content-drawer
    • sw-ui-control-bar
    • sw-ui-dialpad
    • sw-ui-dropup
    • sw-ui-icon
    • sw-ui-modal
    • sw-ui-responsive-container
    • sw-ui-split-button
    • sw-ui-transcript-view
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • class: SwLocalCamera, sw-local-camera
  • Fields
  • stream
  • videoMuted
  • call
  • mirror
  • Attributes
  • CSS Properties
  • CSS Parts
Web Components

sw-local-camera

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

sw-participant-controls

Next
Built with

Aspect-ratio-aware preview tile for the local camera, with a “camera off” placeholder when video is muted or the stream is missing.

1<sw-call-provider token="YOUR_GUEST_TOKEN">
2 <sw-local-camera></sw-local-camera>
3</sw-call-provider>

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

class: SwLocalCamera, sw-local-camera

Fields

stream
MediaStream | nullDefaults to null

Explicit stream — highest precedence.

videoMuted
boolean | undefined

Explicit muted flag — overrides devicesContext.videoMuted.

call
Call | undefined

Explicit Call — used when .stream is not set. Bypasses context.

mirror
booleanDefaults to false

mirror field.

Attributes

NameFieldInherited From
video-mutedvideoMuted
mirrormirror
callcall

CSS Properties

NameDefaultDescription
--sw-local-camera-aspect16/9Aspect ratio of the tile. Automatically rewritten to match the active track’s orientation (e.g. `9 / 16` for portrait phone cameras).

CSS Parts

NameDescription
videoThe internal `<video>` element rendering the local stream (`autoplay`, `muted`, `playsinline`).
placeholderThe “camera off” overlay shown while video is muted or no stream is bound.