DeviceState

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

PropertyTypeDescription
microphoneStatusStateFlow<DeviceStatus>Microphone status
microphoneLastErrorStateFlow<DeviceError>Microphone error
captureVolumeStateFlow<Int>Capture volume, range 0, 100
currentMicVolumeStateFlow<Int>Current user's actual output volume
outputVolumeStateFlow<Int>Maximum output volume, range 0, 100
cameraStatusStateFlow<DeviceStatus>Camera status
cameraLastErrorStateFlow<DeviceError>Camera error
isFrontCameraStateFlow<Boolean>Whether it's front camera
localMirrorTypeStateFlow<MirrorType>Mirror state
localVideoQualityStateFlow<VideoQuality>Local video quality
currentAudioRouteStateFlow<AudioRoute>Current audio route location
screenStatusStateFlow<DeviceStatus>Screen sharing status
networkInfoStateFlow<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
val cameraStatus: StateFlow<DeviceStatus>

Camera status.

Link copied to clipboard
val captureVolume: StateFlow<Int>

Capture volume, range 0, 100.

Link copied to clipboard

Current audio route location.

Link copied to clipboard
val currentMicVolume: StateFlow<Int>

Current user's actual output volume.

Link copied to clipboard
val isFrontCamera: StateFlow<Boolean>

Whether it's front camera.

Link copied to clipboard
val localMirrorType: StateFlow<MirrorType>

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
val networkInfo: StateFlow<NetworkInfo>

Network information.

Link copied to clipboard
val outputVolume: StateFlow<Int>

Maximum output volume, range 0, 100.

Link copied to clipboard
val screenStatus: StateFlow<DeviceStatus>

Screen sharing status.