diff --git a/.gitignore b/.gitignore index 4ce4464..15ddca1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .packages .pub/ +*.lock build/ diff --git a/README.md b/README.md index 2dcedb5..7f698b4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # 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. +[![pub ver](https://img.shields.io/badge/pub-v0.5.3-blue)](https://pub.dev/packages/video_thumbnail) +[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/justsoft/) - [![pub ver](https://img.shields.io/badge/pub-v0.5.3-blue)](https://pub.dev/packages/video_thumbnail) - [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/justsoft/) +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. -![video-file](https://github.com/justsoft/video_thumbnail/blob/master/video_file.png?raw=true) ![video-url](https://github.com/justsoft/video_thumbnail/blob/master/video_url.png?raw=true) +![video-file](screenshots/video_file.jpg) ![video-url](screenshots/video_url.jpg) ## Methods |function|parameter|description|return| @@ -21,14 +21,30 @@ Warning: **Installing** add [video_thumbnail](https://pub.dev/packages/video_thumbnail) as a dependency in your pubspec.yaml file. + ```yaml dependencies: video_thumbnail: ^0.5.3 ``` + **import** ```dart import 'package:video_thumbnail/video_thumbnail.dart'; ``` + +**Image Provider with flutter memory caching capability** +```dart +Image( + image: VideoThumbnailImage( + videoUri, + timeMs: 10, + maxWidth: 100, + imageFormat: ImageFormat.PNG, + ), + fit: BoxFit.cover, +) +``` + **Generate a thumbnail in memory from video file** ```dart final uint8list = await VideoThumbnail.thumbnailData( diff --git a/example/.gitignore b/example/.gitignore index 9d532b1..7e24244 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1,6 +1,7 @@ # Miscellaneous *.class *.log +*.lock *.pyc *.swp .DS_Store diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index f00cf62..79fe93d 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 29 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -39,7 +39,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "xyz.justsoft.video_thumbnail_example" minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 82e1b4c..b4dfada 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -24,7 +24,8 @@ android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:exported="true">