Cached Video Preview can help you get remote or local video preview image and cache it.
This is example code how to implement this package.
CachedVideoPreview(
path: 'https://www.youtube.com/watch?v=b_sQ9bMltGU',
type: SourceType.remote,
remoteImageBuilder: (BuildContext context, url) =>
Image.network(url),
)
CachedVideoPreview(
path: 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
type: SourceType.remote,
httpHeaders: const <String, String>{},
remoteImageBuilder: (BuildContext context, url) =>
Image.network(url),
)
final File video = File('video.mp4');
CachedVideoPreview(
path: video.path,
type: SourceType.local,
fileImageBuilder: (context, bytes) =>
Image.memory(bytes),
)
Thanks to the authors of these libraries metadata_fetch and video_thumbnail.
Use Issue Tracker for any questions or bug reports.