startCameraCapture abstract method

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

Starts video capture using the camera.

Call this method to start multiple camera captures simultaneously by specifying sourceType. On iOS, to enable multiple camera captures, you must call enableMultiCamera and set enabled to true before calling this method.

  • sourceType Type of video source. See VideoSourceType. iOS devices support up to 2 video streams from camera capture (requires multi-camera or external camera support). Android devices support up to 4 video streams from camera capture (requires multi-camera or external camera support). Desktop supports up to 4 video streams from camera capture.
  • config Video capture configuration. See CameraCapturerConfiguration. On iOS, this parameter has no effect. Use the config parameter in enableMultiCamera to configure video capture settings.

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. See Error Codes for details and resolution suggestions.

Implementation

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