Skip to content

Commit cbe73ab

Browse files
committed
Add version 2.3.0
1 parent 7237d06 commit cbe73ab

File tree

11 files changed

+73
-20
lines changed

11 files changed

+73
-20
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## [2.3.0]
2+
3+
### Changed
4+
5+
* [imgly_sdk] Removed `WRITE_EXTERNAL_STORAGE` permission request when opening the editor on Android.
6+
* [imgly_sdk] Aligned emoji support for iOS and Android. Emoji support is not optimized for cross-platform use and disabled by default. Added option `TextOptions.allowEmojis`.
7+
* [imgly_sdk] Updated documentation for remote resources used in the editor. Remote resources are usable but not optimized and therefore should be downloaded in advance and then passed to the editor as local resources.
8+
9+
### Added
10+
11+
* [imgly_sdk] Added integration and documentation for custom watermark. Use `Configuration.watermark` to add a custom watermark to the image/video.
12+
13+
### Fixed
14+
15+
* Fixed unexpected behavior when invoking multiple requests.
16+
* [imgly_sdk] Fixed `CompositionOptions.personalVideoClips` would not be resolved correctly on Android.
17+
118
## [2.2.0]
219

320
### Changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In order to run any samples or use any wrapper without a watermark,
44
you'll have to purchase a commercial PhotoEditor SDK or VideoEditor SDK
55
license. Visit https://img.ly for more details.
66

7-
Copyright (c) 2014-2021, img.ly GmbH
7+
Copyright (c) 2014-2022, img.ly GmbH
88
All rights reserved.
99

1010
Redistribution and use in source and binary forms, with or without

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add the plugin package to the `pubspec.yaml` file in your project:
2323

2424
```yaml
2525
dependencies:
26-
video_editor_sdk: ^2.2.0
26+
video_editor_sdk: ^2.3.0
2727
```
2828
2929
Install the new dependency:
@@ -57,11 +57,11 @@ flutter pub get
5757
}
5858
dependencies {
5959
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
60-
classpath 'ly.img.android.sdk:plugin:9.1.0'
60+
classpath 'ly.img.android.sdk:plugin:9.2.0'
6161
}
6262
}
6363
```
64-
In order to update VideoEditor SDK for Android replace the version string `9.1.0` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
64+
In order to update VideoEditor SDK for Android replace the version string `9.2.0` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
6565

6666
3. Still in the `android/build.gradle` file (**not** `android/app/build.gradle`), add these lines at the bottom:
6767

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ imglyConfig {
3939
}
4040
}
4141

42-
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "9.1.0"
42+
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "9.2.0"
4343

4444
task checkVersion {
4545
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {

android/gradle.properties

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
3-
android.enableJetifier=true

android/src/main/kotlin/ly/img/flutter/video_editor_sdk/FlutterVESDK.kt

+16-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.json.JSONObject
2929
import java.io.File
3030

3131
import ly.img.flutter.imgly_sdk.FlutterIMGLY
32+
import java.util.UUID
3233

3334
/** FlutterVESDK */
3435
class FlutterVESDK: FlutterIMGLY() {
@@ -48,6 +49,11 @@ class FlutterVESDK: FlutterIMGLY() {
4849
}
4950

5051
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
52+
if (this.result != null) {
53+
result?.error("Multiple requests.", "Cancelled due to multiple requests.", null)
54+
return
55+
}
56+
5157
if (call.method == "openEditor") {
5258
var config = call.argument<MutableMap<String, Any>>("configuration")
5359
val serialization = call.argument<String>("serialization")
@@ -109,6 +115,7 @@ class FlutterVESDK: FlutterIMGLY() {
109115
startEditor(settingsList, EDITOR_RESULT_ID)
110116
} else {
111117
result?.error("VESDK", "The video editor is only available in Android 4.3 and later.", null)
118+
this.result = null
112119
}
113120
}
114121

@@ -133,6 +140,7 @@ class FlutterVESDK: FlutterIMGLY() {
133140
if (source == null) {
134141
if (size != null) {
135142
result?.error("VESDK", "Invalid video size: width and height must be greater than zero.", null)
143+
this.result = null
136144
return
137145
}
138146
val video = videos.first()
@@ -148,6 +156,7 @@ class FlutterVESDK: FlutterIMGLY() {
148156
} else {
149157
if (source == null) {
150158
result?.error("VESDK", "A video composition without assets must have a specific size.", null)
159+
this.result = null
151160
return
152161
}
153162
}
@@ -160,6 +169,7 @@ class FlutterVESDK: FlutterIMGLY() {
160169
startEditor(settingsList, EDITOR_RESULT_ID)
161170
} else {
162171
result?.error("VESDK", "The video editor is only available in Android 4.3 and later.", null)
172+
this.result = null
163173
return
164174
}
165175
}
@@ -196,8 +206,10 @@ class FlutterVESDK: FlutterIMGLY() {
196206
VESDK.initSDKWithLicenseData(license)
197207
IMGLY.authorize()
198208
this.result?.success(null)
209+
this.result = null
199210
} catch (e: AuthorizationException) {
200211
this.result?.error("Invalid license", "The license must be valid.", e.message)
212+
this.result = null
201213
}
202214
}
203215

@@ -211,6 +223,7 @@ class FlutterVESDK: FlutterIMGLY() {
211223
if (resultCode == Activity.RESULT_CANCELED && requestCode == EDITOR_RESULT_ID) {
212224
currentActivity?.runOnUiThread {
213225
this.result?.success(null)
226+
this.result = null
214227
}
215228
return true
216229
} else if (resultCode == Activity.RESULT_OK && requestCode == EDITOR_RESULT_ID) {
@@ -228,8 +241,8 @@ class FlutterVESDK: FlutterIMGLY() {
228241
when (serializationConfig.exportType) {
229242
SerializationExportType.FILE_URL -> {
230243
val uri = serializationConfig.filename?.let {
231-
Uri.parse(it)
232-
} ?: Uri.fromFile(File.createTempFile("serialization", ".json"))
244+
Uri.parse("$it.json")
245+
} ?: Uri.fromFile(File.createTempFile("serialization-" + UUID.randomUUID().toString(), ".json"))
233246
Encoder.createOutputStream(uri).use { outputStream ->
234247
IMGLYFileWriter(settingsList).writeJson(outputStream)
235248
}
@@ -254,6 +267,7 @@ class FlutterVESDK: FlutterIMGLY() {
254267
map["serialization"] = serialization
255268
currentActivity?.runOnUiThread {
256269
this.result?.success(map)
270+
this.result = null
257271
}
258272
return true
259273
}

example/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext.kotlin_version = '1.4.10'
3-
ext.vesdk_version = '9.1.0'
3+
ext.vesdk_version = '9.2.0'
44

55
repositories {
66
google()

example/ios/Podfile.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- imgly_sdk (2.2.0):
3+
- imgly_sdk (2.3.0):
44
- Flutter
5-
- imglyKit (~> 10.28)
6-
- imglyKit (10.28.0)
7-
- video_editor_sdk (2.2.0):
5+
- imglyKit (~> 10.29)
6+
- imglyKit (10.29.0)
7+
- video_editor_sdk (2.3.0):
88
- Flutter
99
- imgly_sdk
1010

@@ -27,9 +27,9 @@ EXTERNAL SOURCES:
2727

2828
SPEC CHECKSUMS:
2929
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
30-
imgly_sdk: 6cfbf5f5f6cb930894cba52eddccb4f5053f1fc1
31-
imglyKit: bfeea206adebae46df97ba75880e743df8c40653
32-
video_editor_sdk: 1d15b32379538515cd124e00f6da034e5a249280
30+
imgly_sdk: eb837fc720405caf0a7c436418017f074a612ba3
31+
imglyKit: 26b2761be3d790354b9a5ffb0c066b320318027c
32+
video_editor_sdk: d41316090df87c37e701cb2331f81dbd6ca738d2
3333

3434
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
3535

ios/Classes/FlutterVESDK.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
3737
guard let arguments = call.arguments as? IMGLYDictionary else { return }
3838

3939
if self.result != nil {
40-
self.result?(FlutterError(code: "multiple_requests", message: "Cancelled due to multiple requests.", details: nil))
41-
self.result = nil
40+
result(FlutterError(code: "Multiple requests.", message: "Cancelled due to multiple requests.", details: nil))
41+
return
4242
}
4343

4444
if call.method == "openEditor" {
@@ -183,26 +183,30 @@ extension FlutterVESDK {
183183
if self.serializationType == IMGLYConstants.kExportTypeFileURL {
184184
guard let exportURL = self.serializationFile else {
185185
self.result?(FlutterError(code: "Serialization failed.", message: "The URL must not be nil.", details: nil))
186+
self.result = nil
186187
return
187188
}
188189
do {
189190
try serializationData.IMGLYwriteToUrl(exportURL, andCreateDirectoryIfNeeded: true)
190191
serialization = self.serializationFile?.absoluteString
191192
} catch let error {
192193
self.result?(FlutterError(code: "Serialization failed.", message: error.localizedDescription, details: error))
194+
self.result = nil
193195
}
194196
} else if self.serializationType == IMGLYConstants.kExportTypeObject {
195197
do {
196198
serialization = try JSONSerialization.jsonObject(with: serializationData, options: .init(rawValue: 0))
197199
} catch let error {
198200
self.result?(FlutterError(code: "Serialization failed.", message: error.localizedDescription, details: error))
201+
self.result = nil
199202
}
200203
}
201204
}
202205

203206
self.dismiss(mediaEditViewController: videoEditViewController, animated: true) {
204207
let res: [String: Any?] = ["video": url?.absoluteString, "hasChanges": videoEditViewController.hasChanges, "serialization": serialization]
205208
self.result?(res)
209+
self.result = nil
206210
}
207211
}
208212

@@ -211,6 +215,7 @@ extension FlutterVESDK {
211215
public func videoEditViewControllerDidFailToGenerateVideo(_ videoEditViewController: VideoEditViewController) {
212216
self.dismiss(mediaEditViewController: videoEditViewController, animated: true) {
213217
self.result?(FlutterError(code: "editor_failed", message: "The editor did fail to generate the video.", details: nil))
218+
self.result = nil
214219
}
215220
}
216221

@@ -219,6 +224,7 @@ extension FlutterVESDK {
219224
public func videoEditViewControllerDidCancel(_ videoEditViewController: VideoEditViewController) {
220225
self.dismiss(mediaEditViewController: videoEditViewController, animated: true) {
221226
self.result?(nil)
227+
self.result = nil
222228
}
223229
}
224230
}

lib/video_editor_sdk.dart

+17
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ class Video {
5454
/// The [video] source should either be a full path, an URI
5555
/// or if it is an asset the relative path as specified in
5656
/// your `pubspec.yaml` file.
57+
/// Remote resources are not optimized and therefore should be downloaded
58+
/// in advance and then passed to the editor as local resources.
5759
Video(String video)
5860
: _video = video,
5961
_videos = null,
6062
_size = null;
6163

6264
/// Creates a new video composition with multiple videos.
65+
/// The [videos] each should either be a full path, an URI
66+
/// or if it is an asset the relative path as specified in
67+
/// your `pubspec.yaml` file.
68+
/// Remote resources are not optimized and therefore should be downloaded
69+
/// in advance and then passed to the editor as local resources.
6370
/// The [size] overrides the natural dimensions of the video(s) passed to the
6471
/// editor. All videos will be fitted to the [size] aspect by adding
6572
/// black bars on the left and right side or top and bottom.
@@ -75,9 +82,19 @@ class Video {
7582
_video = null;
7683

7784
/// The video source.
85+
/// The source should either be a full path, an URI
86+
/// or if it is an asset the relative path as specified in
87+
/// your `pubspec.yaml` file.
88+
/// Remote resources are not optimized and therefore should be downloaded
89+
/// in advance and then passed to the editor as local resources.
7890
final String? _video;
7991

8092
/// The sources for the video composition.
93+
/// The sources should each either be a full path, an URI
94+
/// or if it is an asset the relative path as specified in
95+
/// your `pubspec.yaml` file.
96+
/// Remote resources are not optimized and therefore should be downloaded
97+
/// in advance and then passed to the editor as local resources.
8198
final List<String>? _videos;
8299

83100
/// The [Size] of the composition.

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: video_editor_sdk
22
description: The official Flutter plugin for VideoEditor SDK. Integrate the video editor into your own iOS or Android app - in minutes!
3-
version: 2.2.0
3+
version: 2.3.0
44
homepage: https://www.videoeditorsdk.com
55
repository: https://github.com/imgly/vesdk-flutter
66

@@ -11,7 +11,7 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
imgly_sdk: 2.2.0
14+
imgly_sdk: 2.3.0
1515

1616
dev_dependencies:
1717
flutter_test:

0 commit comments

Comments
 (0)