switchCamera abstract method

Future<int?> switchCamera(
  1. CameraId cameraId
)

Switches mobile front/rear camera.

After the API is called, the local user will receive RTCVideoEventHandler.onVideoDeviceStateChanged.

Return value:

Notes:

  • The front camera is used by default before calling this method.
  • If you are using the camera for video capture, the switching operation takes effect immediately. If the camera is not off, the camera you set will be opened when internal capturing is enabled.

Implementation

Future<int?> switchCamera(CameraId cameraId);