Reputation: 7108
I'm using the video_thumbnail: ^0.5.3
flutter package to present the video's first frame.
Here is my code:
Future<Uint8List?> generateThumbnail(String videoUrl) async {
try {
final thumbnail = await VideoThumbnail.thumbnailData(video: 'https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4');
return thumbnail;
} catch (e) {
if (kDebugMode) {
print('Error generating thumbnail: $e');
}
return null;
}
}
I'm trying to load a list of thumbnails (even from the same URL), but on old IOS devices most of them are not loaded, and I'm getting the above error.
couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12792), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x283be6730 {Error Domain=NSOSStatusErrorDomain Code=-12792 "(null)"}}
Important key points:
Upvotes: 0
Views: 825
Reputation: 384
Ensure your platform configuration has appropriate permissions to make network requests and download/store images.
Upvotes: 0