enableMultiCamera abstract method
- required bool enabled,
- required CameraCapturerConfiguration config,
Enables or disables multi-camera capture.
In scenarios where a video is already being captured using a camera, Agora recommends the following steps to achieve multi-camera capture and publish video: Call this method to enable multi-camera capture. Call startPreview to start local video preview. Call startCameraCapture and set sourceType to specify the second camera for capture. Call joinChannelEx and set publishSecondaryCameraTrack to true to publish the second camera's video stream in the channel. To disable multi-camera capture, refer to the following steps: Call stopCameraCapture. Call this method and set enabled to false. This method is only applicable to iOS. When using multi-camera capture, ensure the system version is 13.0 or above. The minimum supported iOS device models for multi-camera capture are as follows: iPhone XR iPhone XS iPhone XS Max iPad Pro (3rd generation and later) You can call this method to enable multi-camera capture either before or after startPreview : If called before startPreview, the local video preview will display feeds from both cameras simultaneously. If called after startPreview, the SDK will stop the current camera capture first, then start both the original and the second camera. The local video preview may briefly go black before automatically recovering.
enabledWhether to enable multi-camera video capture mode: true : Enables multi-camera capture mode. The SDK uses multiple cameras to capture video. false : Disables multi-camera capture mode. The SDK uses only a single camera to capture video.configConfiguration 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. See Error Codes for details and resolution suggestions.
Implementation
Future<void> enableMultiCamera(
{required bool enabled, required CameraCapturerConfiguration config});