diff --git a/.gitignore b/.gitignore index 4ce4464a..84454599 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ .pub/ build/ +.build/ +.swiftpm/ .idea/ *.iml diff --git a/CHANGELOG.md b/CHANGELOG.md index b500f82e..43ec24cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## 0.5.9 + +* Add Swift Package Manager support for iOS while retaining CocoaPods compatibility. + +## 0.5.8 + +* Give the fork unique Android and iOS plugin identifiers so it can coexist with the original `video_thumbnail` package without namespace, duplicate-class, or method-channel conflicts. + +## 0.5.7 + +* Fix the README example images on pub.dev by using absolute upstream image URLs. + +## 0.5.6+1 + +* Rename the maintained fork to `video_thumbnail_gdx_plus`. +* Update package metadata, documentation, imports, example, and iOS podspec for the new package name. +* Add pub.dev topics, including `gdx`. +* Increase the Gradle heap limit for compatibility with current Flutter Android builds. + ## 0.5.6 * Actually add the namespace fix for Android * Bump to 0.5.6 diff --git a/LICENSE b/LICENSE index af1601d6..cc023fa5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2019 John Zhong +Copyright (c) 2026 Gurwinder Singh (modifications) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000..87891967 --- /dev/null +++ b/NOTICE @@ -0,0 +1,18 @@ +video_thumbnail_gdx_plus + +This project is a maintained fork of video_thumbnail: +https://github.com/justsoft/video_thumbnail + +The original project was created by John Zhong and includes contributions from +Tairs Rzajevs, Grigori, Hafeez Ahmed, Leynier, Andreas Petrov, julek-kal, +Nils Reichardt, Ajb Coder, Brandon Lisonbee, k1zerX, niketatjombay, wangbo4020, +Nailer, ztsyyb, and other contributors recorded in the original repository +history and changelog. + +Maintained fork: +Copyright (c) 2026 Gurwinder Singh +https://gurwinderdevx.com/ +https://github.com/47gurvinder/video_thumbnail + +The source code is distributed under the MIT License in the LICENSE file. The +original copyright notice and license text have been retained. diff --git a/README.md b/README.md index 1d4b003c..0d59cb76 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ -# video_thumbnail +# video_thumbnail_gdx_plus -This plugin generates image thumbnails from video files or URLs on both Android and iOS. It returns an image in memory or saves it as a file with customizable format, resolution, and quality. +This maintained fork of [`video_thumbnail`](https://pub.dev/packages/video_thumbnail) generates image thumbnails from video files or URLs on Android and iOS. It returns an image in memory or saves it as a file with customizable format, resolution, and quality. - [![pub ver](https://img.shields.io/badge/pub-v0.5.6-blue)](https://pub.dev/packages/video_thumbnail) - [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/justsoft/) +[![pub package](https://img.shields.io/pub/v/video_thumbnail_gdx_plus.svg)](https://pub.dev/packages/video_thumbnail_gdx_plus) +[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -![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 thumbnail example](https://raw.githubusercontent.com/justsoft/video_thumbnail/refs/heads/master/video_file.png) +![Video URL thumbnail example](https://raw.githubusercontent.com/justsoft/video_thumbnail/refs/heads/master/video_url.png) + +## Acknowledgements + +This package is based on the original [`justsoft/video_thumbnail`](https://github.com/justsoft/video_thumbnail) project created by John Zhong. Credit remains with John Zhong and all original contributors. See [NOTICE](NOTICE), [LICENSE](LICENSE), and the preserved changelog for attribution and licensing details. This fork is independently maintained and is not presented as an official release of the original project. ## Methods |function|parameter|description|return| @@ -20,14 +25,14 @@ Warning: ## Usage **Installing** -add [video_thumbnail](https://pub.dev/packages/video_thumbnail) as a dependency in your pubspec.yaml file. +Add [video_thumbnail_gdx_plus](https://pub.dev/packages/video_thumbnail_gdx_plus) as a dependency in your `pubspec.yaml` file. ```yaml dependencies: - video_thumbnail: ^0.5.6 + video_thumbnail_gdx_plus: ^0.5.9 ``` **import** ```dart -import 'package:video_thumbnail/video_thumbnail.dart'; +import 'package:video_thumbnail_gdx_plus/video_thumbnail_gdx_plus.dart'; ``` **Generate a thumbnail in memory from video file** ```dart @@ -68,4 +73,22 @@ final fileName = await VideoThumbnail.thumbnailFile( ``` ## Notes -Fork or pull requests are always welcome. Currently it seems have a little performance issue while generating WebP thumbnail by using libwebp under iOS. +Issues and pull requests are welcome in the maintained repository. WebP thumbnail generation using libwebp on iOS may have a performance cost. + +## Need help or a custom solution? + +Need help integrating this package, maintaining an existing Flutter project, or building a custom web, mobile, or AI solution? Get in touch to discuss your requirements: + +- [Contact Gurwinder DevX](https://gurwinderdevx.com/) +- [Hire me on Upwork](https://www.upwork.com/freelancers/gurwinderdevx) + +## Author and support + +Maintained by **Gurwinder Singh**, a full-stack web and mobile application developer and founder of [Gurwinder DevX](https://gurwinderdevx.com/). + +- [GitHub](https://github.com/47gurvinder) +- [LinkedIn](https://www.linkedin.com/in/gurwinderdevx/) +- [Upwork](https://www.upwork.com/freelancers/gurwinderdevx) +- [Buy Me a Coffee](https://buymeacoffee.com/gurwinderdevx) + +If this package helps your project, consider supporting its continued development through Buy Me a Coffee. diff --git a/android/build.gradle b/android/build.gradle index 6399eff4..61aa155b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,34 +1,40 @@ -group 'xyz.justsoft.video_thumbnail' +group 'com.gurwinderdevx.video_thumbnail_gdx_plus' version '1.0-SNAPSHOT' buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:8.11.1' } } rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } } apply plugin: 'com.android.library' android { - compileSdkVersion 33 - namespace 'xyz.justsoft.video_thumbnail' + namespace 'com.gurwinderdevx.video_thumbnail_gdx_plus' + compileSdk 36 defaultConfig { - minSdkVersion 16 + minSdkVersion 19 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + lintOptions { disable 'InvalidPackage' } diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f68..94eab632 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=1G diff --git a/android/settings.gradle b/android/settings.gradle index d4e402fc..1ed7bc09 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1 +1 @@ -rootProject.name = 'video_thumbnail' +rootProject.name = 'video_thumbnail_gdx_plus' diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index d5966dc4..801d64e2 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="com.gurwinderdevx.video_thumbnail_gdx_plus"> diff --git a/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java b/android/src/main/java/com/gurwinderdevx/video_thumbnail_gdx_plus/VideoThumbnailPlugin.java similarity index 98% rename from android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java rename to android/src/main/java/com/gurwinderdevx/video_thumbnail_gdx_plus/VideoThumbnailPlugin.java index 9d4c097b..b89a2472 100644 --- a/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java +++ b/android/src/main/java/com/gurwinderdevx/video_thumbnail_gdx_plus/VideoThumbnailPlugin.java @@ -1,4 +1,4 @@ -package xyz.justsoft.video_thumbnail; +package com.gurwinderdevx.video_thumbnail_gdx_plus; import android.content.Context; import android.graphics.Bitmap; @@ -41,7 +41,7 @@ public class VideoThumbnailPlugin implements FlutterPlugin, MethodCallHandler { public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { context = binding.getApplicationContext(); executor = Executors.newCachedThreadPool(); - channel = new MethodChannel(binding.getBinaryMessenger(), "plugins.justsoft.xyz/video_thumbnail"); + channel = new MethodChannel(binding.getBinaryMessenger(), "plugins.gurwinderdevx.com/video_thumbnail_gdx_plus"); channel.setMethodCallHandler(this); } diff --git a/example/.gitignore b/example/.gitignore index 9d532b18..1214486e 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -26,11 +26,16 @@ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages +.flutter-versions .pub-cache/ .pub/ /build/ +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + # Web related lib/generated_plugin_registrant.dart diff --git a/example/CHANGELOG.md b/example/CHANGELOG.md new file mode 100644 index 00000000..27d3a02b --- /dev/null +++ b/example/CHANGELOG.md @@ -0,0 +1,6 @@ +## 0.1.0 + +* Rename the example app for `video_thumbnail_gdx_plus`. +* Update the local package dependency, import, documentation, and app labels. +* Retain the original thumbnail-generation demonstration behavior. +* Increase the Gradle heap limit for current Android build tooling. diff --git a/example/README.md b/example/README.md index 085cc449..5512ac0b 100644 --- a/example/README.md +++ b/example/README.md @@ -1,16 +1,17 @@ -# video_thumbnail_example +# video_thumbnail_gdx_plus example -Demonstrates how to use the [video_thumbnail](https://pub.dev/packages/video_thumbnail) plugin. +Demonstrates how to use the [video_thumbnail_gdx_plus](https://pub.dev/packages/video_thumbnail_gdx_plus) plugin maintained by [Gurwinder Singh](https://github.com/47gurvinder). ## Getting Started -This project is a starting point for a Flutter application. +From the package root, run: -A few resources to get you started if this is your first Flutter project: +```sh +cd example +flutter pub get +flutter run +``` -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +The app can generate thumbnails from its default video URL or a video selected from the device. -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +See the [package README](../README.md) for API usage, credits, and license information. diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index f00cf629..5a02c515 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,36 +1,22 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' +plugins { + id "com.android.application" + id "dev.flutter.flutter-gradle-plugin" } -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 29 + namespace 'xyz.justsoft.video_thumbnail_example' + compileSdk 36 + ndkVersion "28.2.13676358" sourceSets { main.java.srcDirs += 'src/main/kotlin' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + lintOptions { disable 'InvalidPackage' } @@ -38,10 +24,10 @@ android { defaultConfig { // 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 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdkVersion flutter.minSdkVersion + targetSdkVersion 36 + versionCode flutter.versionCode + versionName flutter.versionName } buildTypes { @@ -56,6 +42,3 @@ android { flutter { source '../..' } - -dependencies { -} diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 82e1b4c5..7171aaa9 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -15,11 +15,12 @@ plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.11.1" apply false + id "org.jetbrains.kotlin.android" version "2.2.20" apply false } + +include ":app" diff --git a/example/ios/.gitignore b/example/ios/.gitignore index e96ef602..151026b9 100644 --- a/example/ios/.gitignore +++ b/example/ios/.gitignore @@ -18,6 +18,7 @@ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig +Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 9367d483..391a902b 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 8.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index 98a90b8a..17adeb14 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -10,78 +10,31 @@ project 'Runner', { 'Release' => :release, } -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches end - generated_key_values + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end -target 'Runner' do - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end +flutter_ios_podfile_setup - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - - # Plugin Pods +target 'Runner' do + use_frameworks! - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - post_install do |installer| installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end + flutter_additional_ios_build_settings(target) end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 329fc9ee..a7e3ef8d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,64 +1,16 @@ PODS: - Flutter (1.0.0) - - image_picker (0.0.1): - - Flutter - - libwebp (1.0.2): - - libwebp/core (= 1.0.2) - - libwebp/dec (= 1.0.2) - - libwebp/demux (= 1.0.2) - - libwebp/dsp (= 1.0.2) - - libwebp/enc (= 1.0.2) - - libwebp/mux (= 1.0.2) - - libwebp/utils (= 1.0.2) - - libwebp/webp (= 1.0.2) - - libwebp/core (1.0.2): - - libwebp/webp - - libwebp/dec (1.0.2): - - libwebp/core - - libwebp/demux (1.0.2): - - libwebp/core - - libwebp/dsp (1.0.2): - - libwebp/core - - libwebp/enc (1.0.2): - - libwebp/core - - libwebp/mux (1.0.2): - - libwebp/core - - libwebp/utils (1.0.2): - - libwebp/core - - libwebp/webp (1.0.2) - - path_provider (0.0.1): - - Flutter - - video_thumbnail (0.0.1): - - Flutter - - libwebp DEPENDENCIES: - Flutter (from `Flutter`) - - image_picker (from `.symlinks/plugins/image_picker/ios`) - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`) - -SPEC REPOS: - https://github.com/CocoaPods/Specs.git: - - libwebp EXTERNAL SOURCES: Flutter: :path: Flutter - image_picker: - :path: ".symlinks/plugins/image_picker/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - video_thumbnail: - :path: ".symlinks/plugins/video_thumbnail/ios" SPEC CHECKSUMS: - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - image_picker: e3eacd46b94694dde7cf2705955cece853aa1a8f - libwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48 - path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d - video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 -PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271 +PODFILE CHECKSUM: 5c8eb167e48255b7544ab290f70b4d6a1076ca06 -COCOAPODS: 1.8.4 +COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 35120831..bd44dede 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,23 +3,20 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 7E06B2185EEAE94F6977F27A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A507D482571027B296F41047 /* Pods_Runner.framework */; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - D746579EB438AF0D217A0528 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0DFB053E797A0962E13A9FED /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -29,8 +26,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -38,18 +33,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0DFB053E797A0962E13A9FED /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 58C1D8B6E096AA6BDC375AEC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 784666492D4C4C64000A1A5F /* FlutterFramework */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterFramework; path = Flutter/ephemeral/Packages/.packages/FlutterFramework; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -57,6 +51,7 @@ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 996A03EEA85B417B2683774F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + A507D482571027B296F41047 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A5AA4E6D0AC82F52462D3691 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -65,9 +60,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - D746579EB438AF0D217A0528 /* libPods-Runner.a in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + 7E06B2185EEAE94F6977F27A /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -77,7 +71,7 @@ 39080DA19EDAB7BFB94FDD52 /* Frameworks */ = { isa = PBXGroup; children = ( - 0DFB053E797A0962E13A9FED /* libPods-Runner.a */, + A507D482571027B296F41047 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -85,9 +79,9 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, + 784666492D4C4C64000A1A5F /* FlutterFramework */, + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -162,13 +156,15 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 70EDC9F318022F7660641D46 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -179,7 +175,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0910; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -198,6 +194,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -225,17 +224,19 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 655143412EF9B73325DBA6F4 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; @@ -255,23 +256,9 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 70EDC9F318022F7660641D46 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -321,7 +308,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -359,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -380,7 +366,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -393,7 +382,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -437,7 +425,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -447,7 +435,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -485,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -506,7 +493,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -530,7 +520,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -565,6 +558,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 786d6aad..7b4bd704 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + @@ -46,12 +65,14 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 949b6789..00000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - BuildSystemType - Original - - diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 11ff4868..5169e840 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -1,60 +1,64 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - video_thumbnail_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - - NSCameraUsageDescription - Camera Access Warning - NSMicrophoneUsageDescription - Uses the microphone to record audio. - NSPhotoLibraryAddUsageDescription - Photo Library Access Warning - NSPhotoLibraryUsageDescription - Photo Library Access Warning - - + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + video_thumbnail_gdx_plus_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + + NSCameraUsageDescription + Camera Access Warning + NSMicrophoneUsageDescription + Uses the microphone to record audio. + NSPhotoLibraryAddUsageDescription + Photo Library Access Warning + NSPhotoLibraryUsageDescription + Photo Library Access Warning + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/example/lib/main.dart b/example/lib/main.dart index 115d516f..9f9f6557 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,10 +1,14 @@ +// Radio.groupValue and Radio.onChanged keep this example compatible with the +// package's Flutter >=3.3.0 constraint. Newer Flutter releases prefer RadioGroup. +// ignore_for_file: deprecated_member_use + import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'dart:io'; -import 'package:video_thumbnail/video_thumbnail.dart'; +import 'package:video_thumbnail_gdx_plus/video_thumbnail_gdx_plus.dart'; import 'package:image_picker/image_picker.dart'; import 'package:path_provider/path_provider.dart'; @@ -21,7 +25,7 @@ class MyApp extends StatelessWidget { class ThumbnailRequest { final String video; - final String thumbnailPath; + final String? thumbnailPath; final ImageFormat imageFormat; final int maxHeight; final int maxWidth; @@ -29,13 +33,13 @@ class ThumbnailRequest { final int quality; const ThumbnailRequest( - {this.video, + {required this.video, this.thumbnailPath, - this.imageFormat, - this.maxHeight, - this.maxWidth, - this.timeMs, - this.quality}); + required this.imageFormat, + required this.maxHeight, + required this.maxWidth, + required this.timeMs, + required this.quality}); } class ThumbnailResult { @@ -43,7 +47,11 @@ class ThumbnailResult { final int dataSize; final int height; final int width; - const ThumbnailResult({this.image, this.dataSize, this.height, this.width}); + const ThumbnailResult( + {required this.image, + required this.dataSize, + required this.height, + required this.width}); } Future genThumbnail(ThumbnailRequest r) async { @@ -66,10 +74,10 @@ Future genThumbnail(ThumbnailRequest r) async { print("thumbnail file is located: $thumbnailPath"); - final file = File(thumbnailPath); + final file = File(thumbnailPath!); bytes = file.readAsBytesSync(); } else { - bytes = await VideoThumbnail.thumbnailData( + bytes = (await VideoThumbnail.thumbnailData( video: r.video, headers: { "USERHEADER1": "user defined header1", @@ -79,7 +87,7 @@ Future genThumbnail(ThumbnailRequest r) async { maxHeight: r.maxHeight, maxWidth: r.maxWidth, timeMs: r.timeMs, - quality: r.quality); + quality: r.quality))!; } int _imageDataSize = bytes.length; @@ -102,7 +110,8 @@ Future genThumbnail(ThumbnailRequest r) async { class GenThumbnailImage extends StatefulWidget { final ThumbnailRequest thumbnailRequest; - const GenThumbnailImage({Key key, this.thumbnailRequest}) : super(key: key); + const GenThumbnailImage({Key? key, required this.thumbnailRequest}) + : super(key: key); @override _GenThumbnailImageState createState() => _GenThumbnailImageState(); @@ -113,12 +122,12 @@ class _GenThumbnailImageState extends State { Widget build(BuildContext context) { return FutureBuilder( future: genThumbnail(widget.thumbnailRequest), - builder: (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData) { - final _image = snapshot.data.image; - final _width = snapshot.data.width; - final _height = snapshot.data.height; - final _dataSize = snapshot.data.dataSize; + final _image = snapshot.data!.image; + final _width = snapshot.data!.width; + final _height = snapshot.data!.height; + final _dataSize = snapshot.data!.dataSize; return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -183,9 +192,9 @@ class _DemoHomeState extends State { int _sizeW = 0; int _timeMs = 0; - GenThumbnailImage _futreImage; + GenThumbnailImage? _futreImage; - String _tempDir; + String? _tempDir; @override void initState() { @@ -275,7 +284,7 @@ class _DemoHomeState extends State { groupValue: _format, value: ImageFormat.JPEG, onChanged: (v) => setState(() { - _format = v; + _format = v!; _editNode.unfocus(); }), ), @@ -289,7 +298,7 @@ class _DemoHomeState extends State { groupValue: _format, value: ImageFormat.PNG, onChanged: (v) => setState(() { - _format = v; + _format = v!; _editNode.unfocus(); }), ), @@ -303,7 +312,7 @@ class _DemoHomeState extends State { groupValue: _format, value: ImageFormat.WEBP, onChanged: (v) => setState(() { - _format = v; + _format = v!; _editNode.unfocus(); }), ), @@ -316,7 +325,7 @@ class _DemoHomeState extends State { ]; return Scaffold( appBar: AppBar( - title: const Text('Thumbnail Plugin example'), + title: const Text('video_thumbnail_gdx_plus example'), ), body: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -349,7 +358,7 @@ class _DemoHomeState extends State { child: ListView( shrinkWrap: true, children: [ - (_futreImage != null) ? _futreImage : SizedBox(), + _futreImage ?? SizedBox(), ], ), ), @@ -379,8 +388,9 @@ class _DemoHomeState extends State { children: [ FloatingActionButton( onPressed: () async { - File video = - await ImagePicker.pickVideo(source: ImageSource.camera); + final video = + await ImagePicker().pickVideo(source: ImageSource.camera); + if (video == null) return; setState(() { _video.text = video.path; }); @@ -393,10 +403,11 @@ class _DemoHomeState extends State { ), FloatingActionButton( onPressed: () async { - File video = - await ImagePicker.pickVideo(source: ImageSource.gallery); + final video = + await ImagePicker().pickVideo(source: ImageSource.gallery); + if (video == null) return; setState(() { - _video.text = video?.path; + _video.text = video.path; }); }, child: Icon(Icons.local_movies), diff --git a/example/pubspec.lock b/example/pubspec.lock index 47d7e94b..d6bfcff2 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,69 +1,118 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.13.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72" + url: "https://pub.dev" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "28bb3ae56f117b5aec029d702a90f57d285cd975c3c5c281eaca38dbc47c5937" + url: "https://pub.dev" + source: hosted + version: "0.3.5+2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.3" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "2567f398e06ac72dcf2e98a0c95df2a9edd03c2c2e0cacd4780f20cdf56263a0" + url: "https://pub.dev" + source: hosted + version: "0.9.4" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "5e0bbe9c312416f1787a68259ea1505b52f258c587f12920422671807c4d618a" + url: "https://pub.dev" source: hosted - version: "0.1.3" - file: + version: "0.9.5" + file_selector_platform_interface: dependency: transitive description: - name: file - url: "https://pub.dartlang.org" + name: file_selector_platform_interface + sha256: "35e0bd61ebcdb91a3505813b055b09b79dfdc7d0aee9c09a7ba59ae4bb13dc85" + url: "https://pub.dev" source: hosted - version: "5.2.1" + version: "2.7.0" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "62197474ae75893a62df75939c777763d39c2bc5f73ce5b88497208bc269abfd" + url: "https://pub.dev" + source: hosted + version: "0.9.3+5" flutter: dependency: "direct main" description: flutter @@ -73,222 +122,352 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "3854fe5e3bff0b113c658f260b90c95dea17c92db0f2addeac2e343dd9969785" + url: "https://pub.dev" source: hosted - version: "1.0.11" + version: "2.0.35" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" source: hosted - version: "0.12.2" + version: "1.6.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "4.1.2" image_picker: - dependency: "direct dev" + dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + sha256: "91c025426c2881c551100bce834e201c835a170151545f58d17da5180ca7d9ac" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "6f3a1995eafb000333174fae92202622033b0ee7fd917a6cd3730295264df84a" + url: "https://pub.dev" + source: hosted + version: "0.8.13+19" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "66257a3191ab360d23a55c8241c91a6e329d31e94efa7be9cf7a212e65850214" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: b9c4a438a9ff4f60808c9cf0039b93a42bb6c2211ef6ebb647394b2b3fa84588 + url: "https://pub.dev" source: hosted - version: "0.6.7+15" + version: "0.8.13+6" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "1f81c5f2046b9ab724f85523e4af65be1d47b038160a8c8deed909762c308ed4" + url: "https://pub.dev" + source: hosted + version: "0.2.2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "86f0f15a309de7e1a552c12df9ce5b59fe927e71385329355aec4776c6a8ec91" + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + sha256: "567e056716333a1647c64bb6bd873cff7622233a5c3f694be28a583d4715690c" + url: "https://pub.dev" source: hosted - version: "1.1.1" - intl: + version: "2.11.1" + image_picker_windows: dependency: transitive description: - name: intl - url: "https://pub.dartlang.org" + name: image_picker_windows + sha256: d248c86554a72b5495a31c56f060cf73a41c7ff541689327b1a7dbccc33adfae + url: "https://pub.dev" source: hosted - version: "0.16.1" + version: "0.2.2" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + url: "https://pub.dev" + source: hosted + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.13.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.18.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path_provider: - dependency: "direct dev" + dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 + url: "https://pub.dev" source: hosted - version: "1.6.24" - path_provider_linux: + version: "2.1.6" + path_provider_android: dependency: transitive description: - name: path_provider_linux - url: "https://pub.dartlang.org" + name: path_provider_android + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" + url: "https://pub.dev" source: hosted - version: "0.0.1+2" - path_provider_macos: + version: "2.3.1" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "6d13aece7b3f5c5a9731eaf553ff9dcbc2eff41087fd2df587fd0fed9a3eb0c4" + url: "https://pub.dev" source: hosted - version: "0.0.4+6" + version: "2.5.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.1.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" source: hosted - version: "0.0.4+3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" + version: "2.3.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "1.0.3" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" + version: "2.1.8" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a + url: "https://pub.dev" source: hosted version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4 + url: "https://pub.dev" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830 + url: "https://pub.dev" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + url: "https://pub.dev" source: hosted - version: "0.4.8" + version: "0.7.11" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" source: hosted - version: "2.1.1" - video_thumbnail: - dependency: "direct dev" + version: "2.2.0" + video_thumbnail_gdx_plus: + dependency: "direct main" description: path: ".." relative: true source: path - version: "0.5.1" - win32: + version: "0.5.9" + vm_service: dependency: transitive description: - name: win32 - url: "https://pub.dartlang.org" + name: vm_service + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" + url: "https://pub.dev" source: hosted - version: "1.7.4" + version: "15.2.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" source: hosted - version: "0.1.2" + version: "1.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=1.12.13+hotfix.5" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 2805862a..a19bd2ae 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,24 +1,25 @@ -name: video_thumbnail_example -description: Demonstrates how to use the video_thumbnail plugin. -version: 0.1.7 +name: video_thumbnail_gdx_plus_example +description: Demonstrates how to use the video_thumbnail_gdx_plus plugin. +version: 0.1.0 publish_to: 'none' environment: - sdk: ">=2.5.2 <3.0.0" + sdk: '>=3.0.0 <4.0.0' + flutter: ">=3.3.0" dependencies: flutter: sdk: flutter + image_picker: ^1.1.2 + path_provider: ^2.1.4 + video_thumbnail_gdx_plus: + path: ../ + dev_dependencies: flutter_test: sdk: flutter - image_picker: '>=0.6.2 <2.0.0' - path_provider: ^1.6.0 - video_thumbnail: - path: ../ - # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index eb1c6180..380ef811 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -1,29 +1,34 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:video_thumbnail_gdx_plus_example/main.dart'; -//import 'package:flutter/material.dart'; -//import 'package:flutter_test/flutter_test.dart'; +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); -//import 'package:video_thumbnail_example/main.dart'; + const pathProviderChannel = MethodChannel('plugins.flutter.io/path_provider'); -void main() { - /* - testWidgets('Verify Platform version', (WidgetTester tester) async { - // Build our app and trigger a frame. + setUp(() { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(pathProviderChannel, (call) async { + if (call.method == 'getTemporaryDirectory') { + return '/tmp'; + } + return null; + }); + }); + + tearDown(() { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(pathProviderChannel, null); + }); + + testWidgets('example app starts with the renamed package title', + (tester) async { await tester.pumpWidget(MyApp()); + await tester.pump(); - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data.startsWith('Running on:'), - ), - findsOneWidget, - ); + expect(find.text('video_thumbnail_gdx_plus example'), findsOneWidget); + expect(find.text('Data'), findsOneWidget); + expect(find.text('File'), findsOneWidget); }); - */ } diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/ios/Classes/VideoThumbnailPlugin.h b/ios/Classes/VideoThumbnailPlugin.h deleted file mode 100644 index 23e1edf4..00000000 --- a/ios/Classes/VideoThumbnailPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface VideoThumbnailPlugin : NSObject -@end diff --git a/ios/video_thumbnail.podspec b/ios/video_thumbnail.podspec deleted file mode 100644 index bc6783f5..00000000 --- a/ios/video_thumbnail.podspec +++ /dev/null @@ -1,25 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'video_thumbnail' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.pod_target_xcconfig = { - 'USER_HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/libwebp/**' - } - s.dependency 'Flutter' - s.dependency 'libwebp' - - s.ios.deployment_target = '8.0' -end - diff --git a/ios/video_thumbnail_gdx_plus.podspec b/ios/video_thumbnail_gdx_plus.podspec new file mode 100644 index 00000000..54e22852 --- /dev/null +++ b/ios/video_thumbnail_gdx_plus.podspec @@ -0,0 +1,27 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'video_thumbnail_gdx_plus' + s.version = '0.5.9' + s.summary = 'Generate image thumbnails from local video files or video URLs.' + s.description = <<-DESC +A maintained fork of video_thumbnail for generating image thumbnails on iOS. + DESC + s.homepage = 'https://gurwinderdevx.com/' + s.license = { :file => '../LICENSE' } + s.author = { + 'Gurwinder Singh' => 'contact@gurwinderdevx.com', + 'John Zhong and original contributors' => 'john138@gmail.com' + } + s.source = { :path => '.' } + s.source_files = 'video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/**/*.{h,m}' + s.public_header_files = 'video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/include/**/*.h' + s.pod_target_xcconfig = { + 'USER_HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/libwebp/**' + } + s.dependency 'Flutter' + s.dependency 'libwebp' + + s.ios.deployment_target = '12.0' +end diff --git a/ios/video_thumbnail_gdx_plus/Package.swift b/ios/video_thumbnail_gdx_plus/Package.swift new file mode 100644 index 00000000..e9ff51e1 --- /dev/null +++ b/ios/video_thumbnail_gdx_plus/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "video_thumbnail_gdx_plus", + platforms: [ + .iOS("12.0") + ], + products: [ + .library( + name: "video-thumbnail-gdx-plus", + targets: ["video_thumbnail_gdx_plus"] + ) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework"), + .package( + url: "https://github.com/SDWebImage/libwebp-Xcode.git", + from: "1.5.0" + ) + ], + targets: [ + .target( + name: "video_thumbnail_gdx_plus", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + .product(name: "libwebp", package: "libwebp-xcode") + ], + cSettings: [ + .headerSearchPath("include/video_thumbnail_gdx_plus") + ] + ) + ] +) diff --git a/ios/Classes/VideoThumbnailPlugin.m b/ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.m similarity index 91% rename from ios/Classes/VideoThumbnailPlugin.m rename to ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.m index 67f6a7e6..5c8e6210 100644 --- a/ios/Classes/VideoThumbnailPlugin.m +++ b/ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.m @@ -1,8 +1,10 @@ -#import "VideoThumbnailPlugin.h" +#import "./include/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.h" #import #import -#if __has_include("webp/decode.h") && __has_include("webp/encode.h") && __has_include("webp/demux.h") && __has_include("webp/mux.h") +#if SWIFT_PACKAGE +@import libwebp; +#elif __has_include("webp/decode.h") && __has_include("webp/encode.h") && __has_include("webp/demux.h") && __has_include("webp/mux.h") #import "webp/decode.h" #import "webp/encode.h" #import "webp/demux.h" @@ -14,12 +16,12 @@ #import #endif -@implementation VideoThumbnailPlugin +@implementation VideoThumbnailGdxPlusPlugin + (void)registerWithRegistrar:(NSObject*)registrar { FlutterMethodChannel* channel = [FlutterMethodChannel - methodChannelWithName:@"plugins.justsoft.xyz/video_thumbnail" + methodChannelWithName:@"plugins.gurwinderdevx.com/video_thumbnail_gdx_plus" binaryMessenger:[registrar messenger]]; - VideoThumbnailPlugin* instance = [[VideoThumbnailPlugin alloc] init]; + VideoThumbnailGdxPlusPlugin* instance = [[VideoThumbnailGdxPlusPlugin alloc] init]; [registrar addMethodCallDelegate:instance channel:channel]; } @@ -47,7 +49,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ //Background Thread - result([VideoThumbnailPlugin generateThumbnail:url headers:headers format:format maxHeight:maxh maxWidth:maxw timeMs:timeMs quality:quality]); + result([VideoThumbnailGdxPlusPlugin generateThumbnail:url headers:headers format:format maxHeight:maxh maxWidth:maxw timeMs:timeMs quality:quality]); }); } else if ([@"file" isEqualToString:call.method]) { @@ -58,7 +60,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ //Background Thread - NSData *data = [VideoThumbnailPlugin generateThumbnail:url headers:headers format:format maxHeight:maxh maxWidth:maxw timeMs:timeMs quality:quality]; + NSData *data = [VideoThumbnailGdxPlusPlugin generateThumbnail:url headers:headers format:format maxHeight:maxh maxWidth:maxw timeMs:timeMs quality:quality]; NSString *ext = ( (format == 0 ) ? @"jpg" : ( format == 1 ) ? @"png" : @"webp" ); NSURL *thumbnail = [[url URLByDeletingPathExtension] URLByAppendingPathExtension:ext]; diff --git a/ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/include/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.h b/ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/include/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.h new file mode 100644 index 00000000..16b2ed76 --- /dev/null +++ b/ios/video_thumbnail_gdx_plus/Sources/video_thumbnail_gdx_plus/include/video_thumbnail_gdx_plus/VideoThumbnailGdxPlusPlugin.h @@ -0,0 +1,4 @@ +#import + +@interface VideoThumbnailGdxPlusPlugin : NSObject +@end diff --git a/lib/video_thumbnail.dart b/lib/video_thumbnail_gdx_plus.dart similarity index 88% rename from lib/video_thumbnail.dart rename to lib/video_thumbnail_gdx_plus.dart index 78eb749e..7da66951 100644 --- a/lib/video_thumbnail.dart +++ b/lib/video_thumbnail_gdx_plus.dart @@ -1,13 +1,14 @@ /// The Flutter plugin for creating thumbnail from video /// -/// To use, import `package:video_thumbnail/video_thumbnail.dart`. +/// To use, import +/// `package:video_thumbnail_gdx_plus/video_thumbnail_gdx_plus.dart`. /// /// See also: /// -/// * [video_thumbnail](https://pub.dev/packages/video_thumbnail) +/// * [video_thumbnail_gdx_plus](https://pub.dev/packages/video_thumbnail_gdx_plus) +/// * [Original video_thumbnail project](https://github.com/justsoft/video_thumbnail) /// import 'dart:async'; -import 'dart:typed_data'; import 'package:flutter/services.dart'; @@ -17,7 +18,7 @@ enum ImageFormat { JPEG, PNG, WEBP } class VideoThumbnail { static const MethodChannel _channel = - const MethodChannel('plugins.justsoft.xyz/video_thumbnail'); + const MethodChannel('plugins.gurwinderdevx.com/video_thumbnail_gdx_plus'); /// Generates a thumbnail file under specified thumbnail folder or given full path and name which matches expected ext. /// The video can be a local video file, or an URL repreents iOS or Android native supported video format. diff --git a/pubspec.lock b/pubspec.lock index a91a1d47..2b96897e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -63,50 +63,50 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" matcher: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" path: dependency: transitive description: @@ -164,18 +164,18 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.11" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -185,5 +185,5 @@ packages: source: hosted version: "14.3.1" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.10.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 84755767..c73f7a1a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,14 +1,30 @@ -name: video_thumbnail -description: A flutter plugin for creating a thumbnail from a local video file or from a video URL. -version: 0.5.6 -# author: John Zhong , Tairs Rzajevs , Grigori , Hafeez Ahmed , Leynier , Andreas Petrov, julek-kal, Nils Reichardt, Ajb Coder -homepage: https://github.com/justsoft -repository: https://github.com/justsoft/video_thumbnail -issue_tracker: https://github.com/justsoft/video_thumbnail/issues +name: video_thumbnail_gdx_plus +description: A maintained Flutter plugin for creating image thumbnails from local video files or video URLs on Android and iOS. +version: 0.5.9 +# Originally created by John Zhong and contributors. See NOTICE and LICENSE. +homepage: https://gurwinderdevx.com/ +repository: https://github.com/47gurvinder/video_thumbnail +issue_tracker: https://github.com/47gurvinder/video_thumbnail/issues + +funding: + - https://buymeacoffee.com/gurwinderdevx + +topics: + - video + - thumbnail + - flutter-plugin + - media + - gdx + +screenshots: + - description: Generate a thumbnail from a local video file. + path: video_file.png + - description: Generate a thumbnail from a video URL. + path: video_url.png environment: - sdk: '>=2.16.0 <3.0.0' - flutter: ">=1.10.0" + sdk: '>=3.0.0 <4.0.0' + flutter: ">=3.3.0" dependencies: flutter: @@ -30,10 +46,10 @@ flutter: plugin: platforms: android: - package: xyz.justsoft.video_thumbnail + package: com.gurwinderdevx.video_thumbnail_gdx_plus pluginClass: VideoThumbnailPlugin ios: - pluginClass: VideoThumbnailPlugin + pluginClass: VideoThumbnailGdxPlusPlugin # To add assets to your plugin package, add an assets section, like this: # assets: diff --git a/test/video_thumbnail_test.dart b/test/video_thumbnail_test.dart index 86dd3b60..3198b2bb 100644 --- a/test/video_thumbnail_test.dart +++ b/test/video_thumbnail_test.dart @@ -1,21 +1,26 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:video_thumbnail/video_thumbnail.dart'; +import 'package:video_thumbnail_gdx_plus/video_thumbnail_gdx_plus.dart'; void main() { - const MethodChannel channel = MethodChannel('video_thumbnail'); + TestWidgetsFlutterBinding.ensureInitialized(); + + const MethodChannel channel = + MethodChannel('plugins.gurwinderdevx.com/video_thumbnail_gdx_plus'); setUp(() { - channel.setMockMethodCallHandler((MethodCall methodCall) async { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (MethodCall methodCall) async { final m = methodCall.method; final a = methodCall.arguments; - return '$m=${a["video"]}:${a["path"]}:${a["format"]}:${a["maxhow"]}:${a["quality"]}'; + return '$m=${a["video"]}:${a["path"]}:${a["format"]}:${a["maxw"]}:${a["quality"]}'; }); }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, null); }); test('thumbnailData', () async {