stopVideoRecording method

  1. @override
Future<XFile> stopVideoRecording(
  1. int cameraId
)

Stops the video recording and returns the file where it was saved.

Implementation

@override
Future<XFile> stopVideoRecording(int cameraId) async {
  final String? path = await _channel.invokeMethod<String>(
    'stopVideoRecording',
    <String, dynamic>{'cameraId': cameraId},
  );

  if (path == null) {
    throw CameraException(
      'INVALID_PATH',
      'The platform "$defaultTargetPlatform" did not return a path while reporting success. The platform should always return a valid path or report an error.',
    );
  }

  return XFile(path);
}