Property | Type | Description |
microphoneStatus | Microphone status. | |
microphoneLastError | Microphone error, used to extract error information when an error occurs. | |
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 | Camera status. | |
cameraLastError | Camera error, used to extract error information when an error occurs. | |
isFrontCamera | StateFlow<Boolean> | Whether it's front camera. |
localMirrorType | Mirror state. | |
localVideoQuality | Local video quality. | |
currentAudioRoute | Current audio route location. | |
screenStatus | Screen sharing status. | |
networkInfo | Network information. |
Function | Description |
Singleton object. | |
Open local microphone. | |
Close local microphone. | |
Set capture volume. | |
Set output volume. | |
Set audio route. | |
Start camera test. | |
Stop camera test. | |
Open local camera. | |
Close local camera. | |
Switch camera. | |
Switch mirror state. | |
Update video quality. | |
Start screen sharing. | |
Stop screen sharing. | |
Reset to default state. |
abstract fun openLocalMicrophone(completion: CompletionHandler?)
Parameter | Type | Required | Description |
completion | Required | Whether operation succeeded. |
abstract fun closeLocalMicrophone()
abstract fun setCaptureVolume(volume: Int)
Parameter | Type | Required | Description |
volume | Int | Required | Capture volume, range [0, 100]. |
abstract fun setOutputVolume(volume: Int)
Parameter | Type | Required | Description |
volume | Int | Required | Maximum volume, range [0, 100]. |
abstract fun setAudioRoute(audioRoute: AudioRoute)
Parameter | Type | Required | Description |
audioRoute | Required | Route location. |
abstract fun startCameraTest(cameraView: CameraView, completion: CompletionHandler?)
Parameter | Type | Required | Description |
cameraView | Required | Rendering view for camera capture. | |
completion | Required | Whether operation succeeded. |
abstract fun stopCameraTest()
abstract fun openLocalCamera(isFront: Boolean, completion: CompletionHandler?)
Parameter | Type | Required | Description |
isFront | Boolean | Required | Whether front camera. |
completion | Required | Whether operation succeeded. |
abstract fun closeLocalCamera()
abstract fun switchCamera(isFront: Boolean)
Parameter | Type | Required | Description |
isFront | Boolean | Required | Whether front camera. |
abstract fun switchMirror(mirrorType: MirrorType)
Parameter | Type | Required | Description |
mirrorType | Required | Mirror state. |
abstract fun updateVideoQuality(quality: VideoQuality)
Parameter | Type | Required | Description |
quality | Required | Video quality. |
abstract fun startScreenShare()
abstract fun stopScreenShare()
abstract fun reset()
Enum Value | Value | Description |
MICROPHONE | 0 | Microphone type. |
CAMERA | 1 | Camera type. |
SCREEN_SHARE | 2 | Screen sharing type. |
Enum Value | Value | Description |
NO_ERROR | 0 | Operation successful. |
NO_DEVICE_DETECTED | 1 | No device detected. |
NO_SYSTEM_PERMISSION | 2 | No system permission. |
NOT_SUPPORT_CAPTURE | 3 | Capture not supported. |
OCCUPIED_ERROR | 4 | Device occupied. |
UNKNOWN_ERROR | 5 | Unknown error. |
Enum Value | Value | Description |
OFF | 0 | Off. |
ON | 1 | On. |
Enum Value | Value | Description |
SPEAKERPHONE | 0 | Speaker, using speaker to play (i.e., "hands-free"), located at the bottom of the phone, louder sound, suitable for playing music out loud. |
EARPIECE | 1 | Earpiece, using earpiece to play, located at the top of the phone, quieter sound, suitable for private call scenarios. |
Enum Value | Value | Description |
QUALITY_360P | 1 | 360P. |
QUALITY_540P | 2 | 540P. |
QUALITY_720P | 3 | 720P. |
QUALITY_1080P | 4 | 1080P. |
Enum Value | Value | Description |
UNKNOWN | 0 | Unknown network. |
EXCELLENT | 1 | Excellent. |
GOOD | 2 | Good. |
POOR | 3 | Poor. |
BAD | 4 | Bad. |
VERY_BAD | 5 | Very bad. |
DOWN | 6 | Disconnected. |
Enum Value | Value | Description |
AUTO | 0 | Auto, front camera mirrored, rear camera not mirrored. |
ENABLE | 1 | Both front and rear cameras mirrored. |
DISABLE | 2 | Neither front nor rear camera mirrored. |
Enum Value | Description |
call | Voice call scenario. |
live | Live streaming scenario. |
none | Not set. |
Property | Type | Description |
userID | String | User unique ID. |
quality | Network quality. | |
upLoss | Int | Uplink packet loss rate, range [0, 100]. |
downLoss | Int | Downlink packet loss rate, range [0, 100]. |
delay | Int | Latency (unit: milliseconds). |
Property | Type | Description |
microphoneStatus | Microphone status. | |
microphoneLastError | Microphone error, used to extract error information when an error occurs. | |
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 | Camera status. | |
cameraLastError | Camera error, used to extract error information when an error occurs. | |
isFrontCamera | StateFlow<Boolean> | Whether it's front camera. |
localMirrorType | Mirror state. | |
localVideoQuality | Local video quality. | |
currentAudioRoute | Current audio route location. | |
screenStatus | Screen sharing status. | |
networkInfo | Network information. |
// Get singleton instanceval store = DeviceStore.shared()// Subscribe to state changeslifecycleScope.launch {store.deviceState.microphoneStatus.collect { status ->println("Microphone status: $status")}}lifecycleScope.launch {store.deviceState.cameraStatus.collect { status ->println("Camera status: $status")}}// Open microphonestore.openLocalMicrophone { code, message ->if (code == 0) {println("Microphone opened successfully")}}// Open front camerastore.openLocalCamera(isFront = true) { code, message ->if (code == 0) {println("Camera opened successfully")}}
Feedback