首页 > 解决方案 > 未处理的异常: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 包含缩略图文件。

标签: flutter

解决方案


推荐阅读