switchCamera method

FutureOr<int> switchCamera(
  1. CameraId cameraId
)

@detail api @hiddensdk(audiosdk) @author zhangzhenyu.samuel @brief Switch to the front-facing/back-facing camera used in the internal video capture
The local client will be informed via onVideoDeviceStateChanged{@link #IRTCEngineEventHandler#onVideoDeviceStateChanged} after calling this API. @param cameraId Camera ID. Refer to CameraId{@link #CameraId} for more details. @return - 0: Success - < 0: Failure @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(CameraId cameraId) async {
  return await nativeCall('switchCamera', [cameraId.$value]);
}