Vignette vidéo Flutter de l'URL
Use the package video_thumbnail:
video_thumbnail: ^0.5.0
//And here's the method to extract a file thumbnail image from video url:
Future<File> getVideoThumbnail (String url) async {
var thumbTempPath = await VideoThumbnail.thumbnailFile(
video: url,
thumbnailPath: (await getTemporaryDirectory()).path,
imageFormat: ImageFormat.WEBP,
maxHeight: 64, // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
quality: 75, // you can change the thumbnail quality here
);
return File(thumbTempPath!);
}
MicroProgramer