justsoft / video_thumbnail

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
MIT License
183 stars 225 forks source link

─── Another exception was thrown: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail) Another exception was thrown: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail) I/flutter (31440): ┌────────────────────── #153

Open fisforfaheem opened 7 months ago

fisforfaheem commented 7 months ago

─── Another exception was thrown: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail) Another exception was thrown: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail) I/flutter (31440): ┌──────────────────────

Akshit792 commented 6 months ago

i'M getting this issue in android Pixel 3a

here's the code which i'm using

Future<String?> getVideoThumbnail({ int? videoItemIndex, required String videoUrl, }) async { try { Uint8List? bytes = await VideoThumbnail.thumbnailData( timeMs: 0, quality: 10, video: videoUrl, imageFormat: ImageFormat.PNG, );

  if (bytes != null) {
    final tempDirectory = await getTemporaryDirectory();

    final String tempPath = tempDirectory.path;

    final String thumbnailPath =
        ("$tempPath/${DateTime.now().microsecondsSinceEpoch}.png");

    await File(thumbnailPath).writeAsBytes(bytes);

    if (videoItemIndex != null &&
        !videoThumbnailsData["thumbnails_data"]
            .containsKey(videoItemIndex)) {
      videoThumbnailsData["thumbnails_data"][videoItemIndex] =
          thumbnailPath;
    }

    return thumbnailPath;
  }

  return null;
} catch (e, s) {
  String errorMsg = ("Get Video Thumbnail\nError: $e");

  errorMsg =
      "${e is PlatformException ? "Platform Exception : " : e is FileSystemException ? "File System Exception :" : ""} :$errorMsg";

  LogPrint().error(
    error: e,
    stackTrace: s,
    errorMsg: errorMsg,
  );

  return null;
}

}

jacekendrick commented 6 months ago

Killing the app, restarting vs code, and rerunning the app fixed this issue for me