> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # DeviceController > Interface for media device management. Interface for media device management. Provides reactive access to available media devices, device selection, and monitoring for device changes (connect/disconnect). ## **Properties** **`audioInputDevices`** `MediaDeviceInfo[]` — required Current snapshot of available audio input devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`audioInputDevices$`** `Observable` — required Observable list of available audio input (microphone) devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`audioInputDisabled`** `boolean` — required Whether audio input is currently disabled. --- **`audioInputDisabled$`** `Observable` — required Observable that emits `true` when audio input is disabled (receive-only). --- **`audioOutputDevices`** `MediaDeviceInfo[]` — required Current snapshot of available audio output devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`audioOutputDevices$`** `Observable` — required Observable list of available audio output (speaker) devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`deviceRecovered$`** `Observable` — required Observable that emits when the SDK auto-switches a device due to disconnect, reconnect, or recovery. See [`DeviceRecoveryEvent`](/docs/browser-sdk/v4/reference/interfaces/device-recovery-event). --- **`errors$`** `Observable` — required Observable stream of errors from device enumeration and monitoring. --- **`selectedAudioInputDevice`** `MediaDeviceInfo | null` — required Currently selected audio input device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedAudioInputDevice$`** `Observable` — required Observable of the currently selected audio input device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedAudioInputDeviceConstraints`** `boolean | MediaTrackConstraints` — required Media track constraints for the selected audio input device. Returns `false` when disabled. See [`MediaTrackConstraints`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). --- **`selectedAudioOutputDevice`** `MediaDeviceInfo | null` — required Currently selected audio output device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedAudioOutputDevice$`** `Observable` — required Observable of the currently selected audio output device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedVideoInputDevice`** `MediaDeviceInfo | null` — required Currently selected video input device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedVideoInputDevice$`** `Observable` — required Observable of the currently selected video input device, or `null` if none. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`selectedVideoInputDeviceConstraints`** `boolean | MediaTrackConstraints` — required Media track constraints for the selected video input device. Returns `false` when disabled. See [`MediaTrackConstraints`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). --- **`videoInputDevices`** `MediaDeviceInfo[]` — required Current snapshot of available video input devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`videoInputDevices$`** `Observable` — required Observable list of available video input (camera) devices. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- **`videoInputDisabled`** `boolean` — required Whether video input is currently disabled. --- **`videoInputDisabled$`** `Observable` — required Observable that emits `true` when video input is disabled (receive-only). --- ## **Methods** ### clearDeviceState() ```ts clearDeviceState(): Promise ``` Clears all device state (history, selections, persisted prefs) and re-enumerates. #### Returns `Promise` --- ### deviceInfoToConstraints() ```ts deviceInfoToConstraints(deviceInfo): MediaTrackConstraints ``` Converts a MediaDeviceInfo to track constraints suitable for `getUserMedia`. #### Parameters **`deviceInfo`** `MediaDeviceInfo | null` — required The device to convert, or `null` for default constraints. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `MediaTrackConstraints` --- ### disableAudioInput() ```ts disableAudioInput(): void ``` Disables audio input (receive-only mode). No track will be acquired. #### Returns `void` --- ### disableDeviceMonitoring() ```ts disableDeviceMonitoring(): void ``` Stops monitoring for media device changes. #### Returns `void` --- ### disableVideoInput() ```ts disableVideoInput(): void ``` Disables video input (receive-only mode). No track will be acquired. #### Returns `void` --- ### enableAudioInput() ```ts enableAudioInput(): void ``` Re-enables audio input, restoring the last selection or auto-selecting. #### Returns `void` --- ### enableDeviceMonitoring() ```ts enableDeviceMonitoring(): void ``` Starts monitoring for media device changes (connect/disconnect). #### Returns `void` --- ### enableVideoInput() ```ts enableVideoInput(): void ``` Re-enables video input, restoring the last selection or auto-selecting. #### Returns `void` --- ### enumerateDevices() ```ts enumerateDevices(): Promise ``` Force a device re-enumeration. #### Returns `Promise` --- ### getDeviceCapabilities() ```ts getDeviceCapabilities(deviceInfo): Promise ``` Returns the capabilities of a media device. #### Parameters **`deviceInfo`** `MediaDeviceInfo` — required The device to query. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `Promise` The device capabilities, or `null` if unavailable. --- ### isValidDevice() ```ts isValidDevice(deviceInfo): Promise ``` Checks whether a device is still available and usable. #### Parameters **`deviceInfo`** `MediaDeviceInfo | null` — required The device to validate, or `null`. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `Promise` `true` if the device is valid and available. Returns `false` for `null`, audio output devices, or unavailable devices. --- ### selectAudioInputDevice() ```ts selectAudioInputDevice(device): void ``` Sets the preferred audio input device for future calls. #### Parameters **`device`** `MediaDeviceInfo | null` — required The device to select, or `null` to use the system default. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `void` --- ### selectAudioOutputDevice() ```ts selectAudioOutputDevice(device): void ``` Sets the preferred audio output device for future calls. #### Parameters **`device`** `MediaDeviceInfo | null` — required The device to select, or `null` to use the system default. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `void` --- ### selectVideoInputDevice() ```ts selectVideoInputDevice(device): void ``` Sets the preferred video input device for future calls. #### Parameters **`device`** `MediaDeviceInfo | null` — required The device to select, or `null` to use the system default. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo). --- #### Returns `void` --- ### setStorageManager() ```ts setStorageManager(storageManager): void ``` Injects the storage manager for device persistence. #### Parameters **`storageManager`** `StorageManager` — required Optional storage manager used to persist device selections. --- #### Returns `void` > Interface for media device management.