startVideoCapturing method

  1. @override
Future<void> startVideoCapturing(
  1. VideoCaptureOptions options
)

Starts a video recording and/or streaming session.

Please see VideoCaptureOptions for documentation on the configuration options.

Implementation

@override
Future<void> startVideoCapturing(VideoCaptureOptions options) async {
  await _channel.invokeMethod<void>(
    'startVideoRecording',
    <String, dynamic>{
      'cameraId': options.cameraId,
      'maxVideoDuration': options.maxDuration?.inMilliseconds,
      'enableStream': options.streamCallback != null,
    },
  );

  if (options.streamCallback != null) {
    _frameStreamController = _createStreamController();
    _frameStreamController!.stream.listen(options.streamCallback);
    _startStreamListener();
  }
}