getVideo static method
Picker that close after selecting 1 video. Here are the different instance
of Future returned depending on outputType
:
-
VideoType.file return a html.File object of the selected video.
-
VideoType.bytes return a Uint8List of the selected video.
html.File videoFile = await getVideo(VideoType.file);
Uint8List videoBytes = await getVideo(VideoType.bytes);
Implementation
static Future<dynamic> getVideo({required VideoType outputType}) async {
switch (outputType) {
case VideoType.file:
return ImagePickerWeb._pickFile('video');
case VideoType.bytes:
final data =
await (_methodChannel.invokeMapMethod<String, dynamic>('pickVideo')
as FutureOr<Map<String, dynamic>>);
final imageData = base64.decode(data['data']);
return imageData;
default:
return null;
}
}