首页 > 其他 > 详细

No implementation found for method file on channel video_thumbnail

时间:2021-06-23 15:21:06      阅读:18      评论:0      收藏:0      [点我收藏+]

在一个flutter项目中,使用了VideoThumbnail来生成视频的截图,但运行会提示“No implementation found for method file on channel video_thumbnail”,相当代码如下:

final thumbnailPath = await VideoThumbnail.thumbnailFile(
    video: video.url,
    thumbnailPath: (await getTemporaryDirectory()).path,
    imageFormat: ImageFormat.WEBP,
    maxHeight: height,
    maxWidth: width,
    // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
    quality: 75,
  );

查看video.url,可以在浏览器中打开。发现是http开头的,估计是android9.x(api27及以上)默认不允许http请求。使用API23的模拟器确实可以正常跑,于是打开android\app\src\main\AndroidManifest.xml,在其application添加

android:usesCleartextTraffic="true"

技术分享图片

 

 

问题解决。以下是我使用的环境

Android Studio 4.1.2

Flutter 2.0.1

 

 

 

No implementation found for method file on channel video_thumbnail

原文:https://www.cnblogs.com/kevin-Y/p/14921386.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!