I'm making a video player, for which I am selecting a video and trying to generate a thumbnail to show.
I'm using the following code to pick Images/videos from the file picker.
import 'dart:html' as html;
startWebFilePicker() async {
html.InputElement uploadInput = html.FileUploadInputElement();
uploadInput.multiple = true;
uploadInput.draggable = true;
uploadInput.click();
uploadInput.onChange.listen((e) {
final files = uploadInput.files;
final file = files[0];
entryFile = file;
String mimeType = lookupMimeType(file.name);
mime = mimeType.split('/')[0];
fileType = mimeType.split('/')[1];
baseName = file.name;
final reader = new html.FileReader();
reader.onLoadEnd.listen((e) {
_handleResult(reader.result);
});
reader.readAsDataUrl(file);
});
}
How can I generate a thumbnail using the video file picked?