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

MissingPluginException(No implementation found for method file on channel plugins.justsoft.xyz/video_thumbnail) #161

Closed VocsyAniket closed 1 month ago

VocsyAniket commented 4 months ago

I'm get video from phone local storage, after get thumbnail file image.

VideoThumbnail Error ----- MissingPluginException(No implementation found for method file on channel plugins.justsoft.xyz/video_thumbnail)
VideoThumbnail Trace ----- #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
<asynchronous suspension>
#1      VideoThumbnail.thumbnailFile (package:video_thumbnail/video_thumbnail.dart:48:12)
<asynchronous suspension>
#2      getVideoThumbImage (package:sing_karaoke/constant.dart:103:19)
<asynchronous suspension>
#3      getVideoFromStorageAndroid (package:sing_karaoke/constant.dart:78:23)
<asynchronous suspension>
#4      MainScreen.build.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:sing_karaoke/UI/mainscreen.dart:108:75)
<asynchronous suspension>
#5      MainScreen.build.<anonymous closure>.<anonymous closure> (package:sing_karaoke/UI/mainscreen.dart:108:35)
<asynchronous suspension>

How to Solve this Issue ???

partha-zoozle commented 4 months ago

is there any solution for this?

hayatshin commented 1 month ago

I have the same issue

VocsyAniket commented 1 month ago

this issue video file from get thumbnail image (this video file path is phone local storage path)

solution below :


/// get thumbnail in file video path
String image = await getVideoThumbImage(videoPath); /// your  videoPath from phone local storage

getVideoThumbImage(videoPathUrl) async {
    try {
      String tempPath = (await getApplicationDocumentsDirectory()).path;
      String? image = await VideoThumbnail.thumbnailFile(
        video: videoPathUrl,
        thumbnailPath: tempPath,
        imageFormat: ImageFormat.JPEG,
        quality: 75,
      );
      return image ?? 'ERROR';
    } catch (e, t) {
      print('VideoThumbnail File Error ----- ${e}');
      print('VideoThumbnail File Trace ----- ${t}');
      return 'ERROR';
    }
}

/// show thumbnail image
Container(
                        decoration: BoxDecoration(                         
                            image: DecorationImage(image: FileImage(File(image), fit: BoxFit.cover)),          
                      ),
VocsyAniket commented 1 month ago

is there any solution for this?

i have already send solution, check this below part

VocsyAniket commented 1 month ago

I have the same issue

i have already send solution, check this below part