pickVideo static method
Future<FileData?>
pickVideo({
- UImageSource source = UImageSource.gallery,
- UCameraOptions options = const UCameraOptions(),
- dynamic action()?,
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;
}