startCameraCapture abstract method

Future<void> startCameraCapture({
  1. required VideoSourceType sourceType,
  2. required CameraCapturerConfiguration config,
})

Starts camera capture.

You can call this method to start capturing video from one or more cameras by specifying sourceType. On the iOS platform, if you want to enable multi-camera capture, you need to call enableMultiCamera and set enabled to true before calling this method.

  • sourceType The type of the video source. See VideoSourceType. On iOS devices, you can capture video from up to 2 cameras, provided the device has multiple cameras or supports external cameras. On Android devices, you can capture video from up to 4 cameras, provided the device has multiple cameras or supports external cameras. On the desktop platforms, you can capture video from up to 4 cameras.
  • config The configuration of the video capture. See CameraCapturerConfiguration. On the iOS platform, this parameter has no practical function. Use the config parameter in enableMultiCamera instead to set the video capture configuration.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> startCameraCapture(
    {required VideoSourceType sourceType,
    required CameraCapturerConfiguration config});