video_thumbnail
video_thumbnail copied to clipboard
release app not showing thumbnail
In my app, I'm listing all the videos from phone storage. In gridview i'm showing all the videos. I'm futurebuilder as a parent for video_thumbnail widget. In emulator it working correctly and showing all the videos with thumbnail but when i'm taking build and running in my phone, it shows only circular progress bar.
My Code:
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
class VideoWithThumbnail extends StatefulWidget {
final String filePath;
VideoWithThumbnail({@required this.filePath});
@override
_VideoWithThumbnailState createState() => _VideoWithThumbnailState();
}
class _VideoWithThumbnailState extends State<VideoWithThumbnail> {
Future futureThumbnail;
void initState() {
super.initState();
futureThumbnail = getThumbnail();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: futureThumbnail,
builder: (context, snapshot) {
if (ConnectionState.done == snapshot.connectionState) {
return Image.memory(snapshot.data);
} else {
return CircularProgressIndicator();
}
},
);
}
Future<Uint8List> getThumbnail() async {
Uint8List unit8List = await VideoThumbnail.thumbnailData(
video: widget.filePath,
imageFormat: ImageFormat.JPEG,
maxWidth:
128, // specify the width of the thumbnail, let the height auto-scaled to keep the source aspect ratio
quality: 25,
);
return unit8List;
}
}
Screenshot:
I'm having the same issue RECENTLY. It was working fine before.
@antonvinceguinto do you find any solution bro, I need to display all the videos from gallery, so i need to show thumbnails for all the videos. Help me bro.
@antonvinceguinto do you find any solution bro, I need to display all the videos from gallery, so i need to show thumbnails for all the videos. Help me bro.
I don't I'm also looking for a solution
@antonvinceguinto if you find any solution, please share brother.
@msarkrish have u guys found any solution for this?
@Sunsiha i solved that problem by using https://pub.dev/packages/photo_gallery this plugin.
i solved that problem set application android:usesCleartextTraffic="true"