pickVideo static method
Future<UFileData?>
pickVideo({
- UImageSource source = UImageSource.gallery,
- UCameraOptions options = const UCameraOptions(),
- dynamic action()?,
Picks a video from the gallery, or records one with source camera. await UFile.pickVideo()
Implementation
static Future<UFileData?> pickVideo({
UImageSource source = UImageSource.gallery,
UCameraOptions options = const UCameraOptions(),
Function(UFileData?)? action,
}) async {
if (source == UImageSource.camera) return recordVideo(options: options, action: action);
final List<UFileData> files = await pickFiles(allowMultiple: false, fileType: FileType.video);
final UFileData? file = files.isEmpty ? null : files.first;
action?.call(file);
return file;
}