enableMultiCamera abstract method

Future<void> enableMultiCamera({
  1. required bool enabled,
  2. required CameraCapturerConfiguration config,
})

Enables or disables multi-camera capture.

In scenarios where there are existing cameras to capture video, Agora recommends that you use the following steps to capture and publish video with multiple cameras: Call this method to enable multi-channel camera capture. Call startPreview to start the local video preview. Call startCameraCapture, and set sourceType to start video capture with the second camera. Call joinChannelEx, and set publishSecondaryCameraTrack to true to publish the video stream captured by the second camera in the channel. If you want to disable multi-channel camera capture, use the following steps: Call stopCameraCapture. Call this method with enabled set to false. You can call this method before and after startPreview to enable multi-camera capture: If it is enabled before startPreview, the local video preview shows the image captured by the two cameras at the same time. If it is enabled after startPreview, the SDK stops the current camera capture first, and then enables the primary camera and the second camera. The local video preview appears black for a short time, and then automatically returns to normal. This method applies to iOS only. When using this function, ensure that the system version is 13.0 or later. The minimum iOS device types that support multi-camera capture are as follows: iPhone XR iPhone XS iPhone XS Max iPad Pro 3rd generation and later

  • enabled Whether to enable multi-camera video capture mode: true : Enable multi-camera capture mode; the SDK uses multiple cameras to capture video. false : Disable multi-camera capture mode; the SDK uses a single camera to capture video.
  • config Capture configuration for the second camera. See CameraCapturerConfiguration.

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> enableMultiCamera(
    {required bool enabled, required CameraCapturerConfiguration config});