当我使用 ImagePicker.pickVideo(source: ImageSource.camera)
时它工作得很好,但如果我使用 ImagePicker.pickVideo(source: ImageSource.gallery)
我收到这个错误
Unhandled Exception: MissingPluginException(No implementation found for method file on channel video_thumbnail)
getVideo() async {
final pickedFile = await ImagePicker.pickVideo(source: ImageSource.gallery);
if(pickedFile != null){
videoAddress = pickedFile.path;
final thumbnailPath = await VideoThumbnail.thumbnailFile(
video: videoAddress,
imageFormat: ImageFormat.JPEG,
quality: 75);
videoPosterAddress = thumbnailPath;
setState(() { videoPoster = File(thumbnailPath); });
}
}
videoPoster 包含缩略图文件。