DeviceController
Interface for media device management.
Provides reactive access to available media devices, device selection, and monitoring for device changes (connect/disconnect).
Properties
audioInputDevices
Current snapshot of available audio input devices. See MediaDeviceInfo.
audioInputDevices$
Observable list of available audio input (microphone) devices. See MediaDeviceInfo.
audioInputDisabled
Whether audio input is currently disabled.
audioInputDisabled$
Observable that emits true when audio input is disabled (receive-only).
audioOutputDevices
Current snapshot of available audio output devices. See MediaDeviceInfo.
audioOutputDevices$
Observable list of available audio output (speaker) devices. See MediaDeviceInfo.
deviceRecovered$
Observable that emits when the SDK auto-switches a device due to disconnect, reconnect, or recovery. See DeviceRecoveryEvent.
errors$
Observable stream of errors from device enumeration and monitoring.
selectedAudioInputDevice
Currently selected audio input device, or null if none. See MediaDeviceInfo.
selectedAudioInputDevice$
Observable of the currently selected audio input device, or null if none. See MediaDeviceInfo.
selectedAudioInputDeviceConstraints
Media track constraints for the selected audio input device. Returns false when disabled. See MediaTrackConstraints.
selectedAudioOutputDevice
Currently selected audio output device, or null if none. See MediaDeviceInfo.
selectedAudioOutputDevice$
Observable of the currently selected audio output device, or null if none. See MediaDeviceInfo.
selectedVideoInputDevice
Currently selected video input device, or null if none. See MediaDeviceInfo.
selectedVideoInputDevice$
Observable of the currently selected video input device, or null if none. See MediaDeviceInfo.
selectedVideoInputDeviceConstraints
Media track constraints for the selected video input device. Returns false when disabled. See MediaTrackConstraints.
videoInputDevices
Current snapshot of available video input devices. See MediaDeviceInfo.
videoInputDevices$
Observable list of available video input (camera) devices. See MediaDeviceInfo.
videoInputDisabled
Whether video input is currently disabled.
videoInputDisabled$
Observable that emits true when video input is disabled (receive-only).
Methods
clearDeviceState()
Clears all device state (history, selections, persisted prefs) and re-enumerates.
Returns
Promise<void>
deviceInfoToConstraints()
Converts a MediaDeviceInfo to track constraints suitable for getUserMedia.
Parameters
deviceInfo
The device to convert, or null for default constraints. See MediaDeviceInfo.
Returns
MediaTrackConstraints
disableAudioInput()
Disables audio input (receive-only mode). No track will be acquired.
Returns
void
disableDeviceMonitoring()
Stops monitoring for media device changes.
Returns
void
disableVideoInput()
Disables video input (receive-only mode). No track will be acquired.
Returns
void
enableAudioInput()
Re-enables audio input, restoring the last selection or auto-selecting.
Returns
void
enableDeviceMonitoring()
Starts monitoring for media device changes (connect/disconnect).
Returns
void
enableVideoInput()
Re-enables video input, restoring the last selection or auto-selecting.
Returns
void
enumerateDevices()
Force a device re-enumeration.
Returns
Promise<void>
getDeviceCapabilities()
Returns the capabilities of a media device.
Parameters
deviceInfo
The device to query. See MediaDeviceInfo.
Returns
Promise<MediaTrackCapabilities | null>
The device capabilities, or null if unavailable.
isValidDevice()
Checks whether a device is still available and usable.
Parameters
deviceInfo
The device to validate, or null. See MediaDeviceInfo.
Returns
Promise<boolean>
true if the device is valid and available. Returns false for null, audio output devices, or unavailable devices.
selectAudioInputDevice()
Sets the preferred audio input device for future calls.
Parameters
device
The device to select, or null to use the system default. See MediaDeviceInfo.
Returns
void
selectAudioOutputDevice()
Sets the preferred audio output device for future calls.
Parameters
device
The device to select, or null to use the system default. See MediaDeviceInfo.
Returns
void
selectVideoInputDevice()
Sets the preferred video input device for future calls.
Parameters
device
The device to select, or null to use the system default. See MediaDeviceInfo.
Returns
void
setStorageManager()
Injects the storage manager for device persistence.
Parameters
storageManager
Optional storage manager used to persist device selections.
Returns
void