sw-device-selector
sw-device-selector
sw-device-selector
Single-button popover that lets the user pick microphone, camera, and speaker devices, with optional live preview of each.
The trigger renders as a small icon button; clicking it opens a panel
with three sections (Microphone, Camera, Speaker), each populated from
the corresponding observable on the bound DeviceController:
audioInputDevices$, videoInputDevices$, audioOutputDevices$. The
currently selected device is read from
selectedAudio[Input|Output]Device$ / selectedVideoInputDevice$.
When show-preview is set, the open panel also renders:
<sw-local-camera> for the selected
video input.<sw-audio-level>) for the
selected audio input.setSinkId() where supported).Streams are acquired only while the popover is open and stopped as soon
as it closes — no permanent media access. The popover closes on outside
click via a composedPath()-aware document listener.
Class: SwDeviceSelector · Module: packages/web-components/src/components/sw-device-selector/sw-device-selector.ts
SwDeviceSelector, sw-device-selectordeviceController field.
Render inline previews (camera video, mic level, speaker test) inside each section while the panel is open. Streams are acquired only while the panel is open and stopped when it closes.