Device State
data class DeviceState(val microphoneStatus: StateFlow<DeviceStatus>, val microphoneLastError: StateFlow<DeviceError>, val captureVolume: StateFlow<Int>, val currentMicVolume: StateFlow<Int>, val outputVolume: StateFlow<Int>, val cameraStatus: StateFlow<DeviceStatus>, val cameraLastError: StateFlow<DeviceError>, val isFrontCamera: StateFlow<Boolean>, val localMirrorType: StateFlow<MirrorType>, val localVideoQuality: StateFlow<VideoQuality>, val currentAudioRoute: StateFlow<AudioRoute>, val screenStatus: StateFlow<DeviceStatus>, val networkInfo: StateFlow<NetworkInfo>)
Device state
Overview
A comprehensive snapshot of device state, containing all device-related status information including microphone, camera, screen sharing and network.
State Properties Overview
| Property | Type | Description |
| microphoneStatus | StateFlow<DeviceStatus> | Microphone status |
| microphoneLastError | StateFlow<DeviceError> | Microphone error |
| captureVolume | StateFlow<Int> | Capture volume, range 0, 100 |
| currentMicVolume | StateFlow<Int> | Current user's actual output volume |
| outputVolume | StateFlow<Int> | Maximum output volume, range 0, 100 |
| cameraStatus | StateFlow<DeviceStatus> | Camera status |
| cameraLastError | StateFlow<DeviceError> | Camera error |
| isFrontCamera | StateFlow<Boolean> | Whether it's front camera |
| localMirrorType | StateFlow<MirrorType> | Mirror state |
| localVideoQuality | StateFlow<VideoQuality> | Local video quality |
| currentAudioRoute | StateFlow<AudioRoute> | Current audio route location |
| screenStatus | StateFlow<DeviceStatus> | Screen sharing status |
| networkInfo | StateFlow<NetworkInfo> | Network information |
Tip: Device state is automatically updated. Subscribe to deviceState to receive real-time updates.
Constructors
Link copied to clipboard
constructor(microphoneStatus: StateFlow<DeviceStatus>, microphoneLastError: StateFlow<DeviceError>, captureVolume: StateFlow<Int>, currentMicVolume: StateFlow<Int>, outputVolume: StateFlow<Int>, cameraStatus: StateFlow<DeviceStatus>, cameraLastError: StateFlow<DeviceError>, isFrontCamera: StateFlow<Boolean>, localMirrorType: StateFlow<MirrorType>, localVideoQuality: StateFlow<VideoQuality>, currentAudioRoute: StateFlow<AudioRoute>, screenStatus: StateFlow<DeviceStatus>, networkInfo: StateFlow<NetworkInfo>)
Properties
Link copied to clipboard
Camera error, used to extract error information when an error occurs.
Link copied to clipboard
Camera status.
Link copied to clipboard
Capture volume, range 0, 100.
Link copied to clipboard
Current audio route location.
Link copied to clipboard
Current user's actual output volume.
Link copied to clipboard
Whether it's front camera.
Link copied to clipboard
Mirror state.
Link copied to clipboard
Local video quality.
Link copied to clipboard
Microphone error, used to extract error information when an error occurs.
Link copied to clipboard
Microphone status.
Link copied to clipboard
Network information.
Link copied to clipboard
Maximum output volume, range 0, 100.
Link copied to clipboard
Screen sharing status.