flutter - 未处理的异常:MissingPluginException(未找到通道 video_thumbnail 上的方法文件的实现)
问题描述
当我使用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 包含缩略图文件。
解决方案
推荐阅读
- javascript - 正则表达式遵循模式,大括号之间除外
- c++ - 标准库中的排序函数使用迭代器给出错误
- json - Google Apps 脚本:尝试在 API 响应中选择特定对象时返回“null”,但我可以在原始响应中看到它
- java - 编译maven项目时如何隐藏警告?
- reactjs - 系统抛出异常并显示 playerProfile.map 不是函数
- python - 在密集网络中生成和检测社区的模型
- c# - vstudio 调试模式下的 CS0103 说东西不存在
- node.js - 在 alpine linux 上安装 nodejs 10 + npm
- python - seaborn的swarmplot可以调整点的标记形状吗?
- php - 覆盖 WordPress 插件类以更改上传图像大小