I tried to use thumbnail_generator from pub.dev for my project but couldn't been able to generate a thumbnail so far.
I am a nocoder, but I do think the problem is how I use systems file usage or some memory usage that required to store the image?(I donno).
there is no error in the compiler, but when running the thumbnail placeholder returns error.
functionality Iam looking for: user uploads video> thumbnail generated(9:16 ratio), >displayed > submit button> saves the file URL in the firebase collection. (but have no idea how to upload the generated thumbnail into the firebase!)
if anyone could help,
this is the code is used:
import 'package:video_thumbnail/video_thumbnail.dart';
Future<String?> thumbnailGenerator(String? vidUrl) async {
// generate a thumbnail from an uploaded video
if (vidUrl == null) {
return null;
}
final thumbnailPath = await VideoThumbnail.thumbnailFile(
video: vidUrl,
thumbnailPath: (await getTemporaryDirectory()).path,
imageFormat: ImageFormat.JPEG,
maxHeight: 320, // height for 9:16 aspect ratio
maxWidth: 180, // width for 9:16 aspect ratio
quality: 80,
);
return thumbnailPath;
}