pickVideo static method

Future<FileData?> pickVideo({
  1. UImageSource source = UImageSource.gallery,
  2. UCameraOptions options = const UCameraOptions(),
  3. dynamic action(
    1. FileData?
    )?,
})

Picks a video from the gallery, or records one when source is camera.

Implementation

static Future<FileData?> pickVideo({
  UImageSource source = UImageSource.gallery,
  UCameraOptions options = const UCameraOptions(),
  Function(FileData?)? action,
}) async {
  if (source == UImageSource.camera) return recordVideo(options: options, action: action);
  final List<FileData> files = await showFilePicker(fileType: FileType.video);
  final FileData? file = files.isEmpty ? null : files.first;
  action?.call(file);
  return file;
}