diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml
index b0f6971..53449da 100644
--- a/.idea/libraries/Flutter_Plugins.xml
+++ b/.idea/libraries/Flutter_Plugins.xml
@@ -1,6 +1,8 @@
-
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index fd7e919..c209b34 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -14,18 +14,24 @@
+
-
-
-
+
+
+
+
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16bfc63..00a3575 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,5 @@
+## 1.2.9
+add maxTime for pick video
## 1.2.8
fix android filename error
## 1.2.7
diff --git a/README.md b/README.md
index f8c7ec8..e390a10 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# images_picker
-[![images-picker](https://img.shields.io/badge/pub-1.2.8-orange)](https://pub.dev/packages/images_picker)
+[![images-picker](https://img.shields.io/badge/pub-1.2.9-orange)](https://pub.dev/packages/images_picker)
Flutter plugin for selecting images/videos from the Android and iOS image library, and taking pictures/videos with the camera,save image/video to album/gallery
@@ -91,6 +91,13 @@ ImagesPicker.pick(
gif: true, // default is true
);
```
+- add max video duration pick
+```dart
+ImagesPicker.pick(
+ // ...
+ maxTime: 30, // second
+);
+```
- add cropper (gif crop unsupported)
```dart
ImagesPicker.pick(
@@ -149,6 +156,7 @@ Future downloadFile(String url) async {
int count = 1,
PickType pickType = PickType.image,
bool gif = true,
+int maxTime = 120,
CropOption cropOpt,
int maxSize,
double quality,
diff --git a/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java b/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java
index 9f7e63e..169be90 100644
--- a/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java
+++ b/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java
@@ -133,6 +133,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
String pickType = call.argument("pickType");
double quality = call.argument("quality");
boolean supportGif = call.argument("gif");
+ int maxTime = call.argument("maxTime");
HashMap cropOption = call.argument("cropOption");
String language = call.argument("language");
@@ -154,6 +155,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
Utils.setPhotoSelectOpt(model, count, quality);
if (cropOption!=null) Utils.setCropOpt(model, cropOption);
model.isGif(supportGif);
+ model.videoMaxSecond(maxTime);
resolveMedias(model);
break;
}
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
index 2ec8d82..98e259e 100644
--- a/example/ios/Podfile.lock
+++ b/example/ios/Podfile.lock
@@ -2,10 +2,10 @@ PODS:
- Flutter (1.0.0)
- images_picker (0.0.1):
- Flutter
- - ZLPhotoBrowser (= 4.1.9)
- - ZLPhotoBrowser (4.1.9):
- - ZLPhotoBrowser/Core (= 4.1.9)
- - ZLPhotoBrowser/Core (4.1.9)
+ - ZLPhotoBrowser (= 4.2.0)
+ - ZLPhotoBrowser (4.2.0):
+ - ZLPhotoBrowser/Core (= 4.2.0)
+ - ZLPhotoBrowser/Core (4.2.0)
DEPENDENCIES:
- Flutter (from `Flutter`)
@@ -23,8 +23,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
- images_picker: 7326dd6463f772a69f68bc228ebfabd7db3917c4
- ZLPhotoBrowser: 320aec37f64b0f58d40abd852956c64530011ea4
+ images_picker: 8508f4097cec731ab87d47564ed964aa3fe942c7
+ ZLPhotoBrowser: 602d505d4f2cf7f309ce973c4353d33e85216d58
PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 8e6e697..959c900 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -39,6 +39,7 @@ class _MyAppState extends State {
count: 3,
pickType: PickType.all,
language: Language.System,
+ maxTime: 30,
// maxSize: 500,
// cropOpt: CropOption(
// aspectRatio: CropAspectRatio.wh16x9,
diff --git a/example/pubspec.lock b/example/pubspec.lock
index ad2ade5..e9db8c1 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
- version: "1.2.7"
+ version: "1.2.8"
matcher:
dependency: transitive
description:
diff --git a/images_picker.iml b/images_picker.iml
index ffecf49..e839123 100644
--- a/images_picker.iml
+++ b/images_picker.iml
@@ -25,6 +25,5 @@
-
\ No newline at end of file
diff --git a/ios/Classes/SwiftImagesPickerPlugin.swift b/ios/Classes/SwiftImagesPickerPlugin.swift
index 47c07b8..1349886 100644
--- a/ios/Classes/SwiftImagesPickerPlugin.swift
+++ b/ios/Classes/SwiftImagesPickerPlugin.swift
@@ -27,6 +27,7 @@ public class SwiftImagesPickerPlugin: NSObject, FlutterPlugin {
let language = args!["language"] as! String;
let pickType = args!["pickType"] as? String;
let supportGif = args!["gif"] as! Bool;
+ let maxTime = args!["maxTime"] as! Int;
let maxSize = args!["maxSize"] as? Int;
let cropOption = args!["cropOption"] as? NSDictionary;
let theme = args!["theme"] as? NSDictionary;
@@ -38,6 +39,7 @@ public class SwiftImagesPickerPlugin: NSObject, FlutterPlugin {
self.setConfig(configuration: config, pickType: pickType);
config.maxSelectCount = count;
config.allowSelectGif = supportGif;
+ config.maxSelectVideoDuration = maxTime;
if cropOption != nil {
config.allowEditImage = true;
let corpType = cropOption!["cropType"] as! String;
diff --git a/ios/images_picker.podspec b/ios/images_picker.podspec
index dcf8fec..b3e7fa7 100644
--- a/ios/images_picker.podspec
+++ b/ios/images_picker.podspec
@@ -15,7 +15,7 @@ A new flutter plugin project.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
- s.dependency 'ZLPhotoBrowser', '4.1.9'
+ s.dependency 'ZLPhotoBrowser', '4.2.0'
s.platform = :ios, '10.0'
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
diff --git a/lib/images_picker.dart b/lib/images_picker.dart
index efd09b9..a5b50cc 100644
--- a/lib/images_picker.dart
+++ b/lib/images_picker.dart
@@ -10,6 +10,7 @@ class ImagesPicker {
int count = 1,
PickType pickType = PickType.image,
bool gif = true,
+ int maxTime = 120,
CropOption? cropOpt,
int? maxSize,
double? quality,
@@ -28,6 +29,7 @@ class ImagesPicker {
"count": count,
"pickType": pickType.toString(),
"gif": gif,
+ "maxTime": maxTime,
"maxSize": maxSize ?? null,
"quality": quality ?? -1,
"cropOption": cropOpt != null
diff --git a/pubspec.yaml b/pubspec.yaml
index 5763ec9..8c64d0a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: images_picker
description: Flutter plugin for selecting images/videos from the Android and iOS image library, and taking pictures/videos with the camera,save image/video to album/gallery.
-version: 1.2.8
+version: 1.2.9
homepage: https://github.com/chavesgu/images_picker
environment: