switchCamera method
@hidden(macOS)
@detail api
@hiddensdk(audiosdk)
@author zhangzhenyu.samuel
@brief Switches to the front-facing/back-facing camera used in the internal video capture
The local client will be informed via rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error} after calling this API.
@param cameraId Camera type. Refer to ByteRTCCameraID{@link #ByteRTCCameraID} for more details.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- Front-facing camera is the default camera.
- If the internal video capturing is on, the switch is effective once you call this API. If the internal video capturing is off, the setting will be effective when capture starts.
Implementation
FutureOr<int> switchCamera(ByteRTCCameraID cameraId) async {
return await nativeCall('switchCamera:', [cameraId.$value]);
}