Open marcobraghim opened 2 years ago
I encountered the same issue when I was trying to get a thumbnail from a video taken by camera. This seems to happen on iOS only. Here's a workaround.
Future<AssetEntity?> fetchLatestVideoAsset() async {
final albums = await PhotoManager.getAssetPathList(
onlyAll: true,
type: RequestType.video,
);
if (albums.isEmpty) return null;
final assets = await albums.first.getAssetListPaged(0, 1);
return assets.first;
}
fetchLatestVideoAsset
Thanks for the answer and this workaround. Anyway, we need this issue to be fixed...
I have a fix, though I am not sure it's the proper fix. I found that if you set the requestedTimeToleranceAfter to 100ms, then the thumbnail is properly generated. I forked the repo and made a change myself for a personal project here:
https://github.com/mjbader/video_thumbnail/commit/5971ca77cd8b588f8806b99bf80916327e8551fa
I'm gonna try and use this fix now. @mjbader are you still using your fork successfully ?
@mjbader Thank you for sharing this fix.
I don't know why this error is occurring and I don't know how to reproduce it because this error does not happen every time...
OS: iOS
Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision cf44000065 (2 weeks ago) • 2021-12-08 14:06:50 -0800 Engine • revision 40a99c5951 Tools • Dart 2.15.0
Flutter Doctor: No issues found!