Skip to content

Commit 83fd896

Browse files
committed
Add version 3.0.0
1 parent 3d23e72 commit 83fd896

File tree

8 files changed

+46
-31
lines changed

8 files changed

+46
-31
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [3.0.0]
2+
3+
### Changed
4+
5+
* Changed and aligned the error codes for the plugins.
6+
* [imgly_sdk] Removed custom `Color` class and replaced its usage with the `dart:ui` `Color` class.
7+
* [video_editor_sdk] Unlocking the license via `VESDK.unlockWithLicense` is now executing asynchronously.
8+
* [photo_editor_sdk] Unlocking the license via `PESDK.unlockWithLicense` is now executing asynchronously.
9+
10+
### Fixed
11+
12+
* [video_editor_sdk] Fixed tint color of the toolbar would not be applied correctly in the trim tool on iOS.
13+
114
## [2.9.0]
215

316
### Added

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Add the plugin package to the `pubspec.yaml` file in your project:
3030

3131
```yaml
3232
dependencies:
33-
video_editor_sdk: ^2.9.0
33+
video_editor_sdk: ^3.0.0
3434
```
3535
3636
Install the new dependency:

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class FlutterVESDK: FlutterIMGLY() {
6666

6767
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
6868
if (this.result != null) {
69-
result.error("Multiple requests.", "Cancelled due to multiple requests.", null)
69+
result.error(IMGLYConstants.K_ERROR_MULTIPLE_REQUESTS, "Cancelled due to multiple requests.", null)
7070
return
7171
}
7272

@@ -97,7 +97,7 @@ class FlutterVESDK: FlutterIMGLY() {
9797
this.present(videoSegments, config, serialization, size)
9898
}
9999
} else {
100-
result.error("VE.SDK", "The video must not be null", null)
100+
result.error(IMGLYConstants.K_ERROR_UNABLE_TO_LOAD, "The video must not be null", null)
101101
}
102102
} else if (call.method == "unlock") {
103103
val license = call.argument<String>("license")
@@ -106,7 +106,7 @@ class FlutterVESDK: FlutterIMGLY() {
106106
} else if (call.method == "release") {
107107
val identifier = call.argument<String>("identifier")
108108
if (identifier == null) {
109-
result.error("VE.SDK", "The identifier must not be null", null)
109+
result.error(IMGLYConstants.K_ERROR_UNABLE_TO_RELEASE, "The identifier must not be null", null)
110110
} else {
111111
this.result = result
112112
this.releaseTemporaryData(identifier)
@@ -170,7 +170,7 @@ class FlutterVESDK: FlutterIMGLY() {
170170
if (videoArray.isNotEmpty()) {
171171
if (source == null) {
172172
if (size != null) {
173-
result?.error("VE.SDK", "Invalid video size: width and height must be greater than zero.", null)
173+
result?.error(IMGLYConstants.K_ERROR_UNABLE_TO_LOAD, "Invalid video size: width and height must be greater than zero.", null)
174174
return
175175
}
176176
val video = videoArray.first()
@@ -184,7 +184,7 @@ class FlutterVESDK: FlutterIMGLY() {
184184
}
185185
} else {
186186
if (source == null) {
187-
result?.error("VE.SDK", "A video composition without assets must have a specific size.", null)
187+
result?.error(IMGLYConstants.K_ERROR_UNABLE_TO_LOAD, "A video composition without assets must have a specific size.", null)
188188
this.result = null
189189
return
190190
}
@@ -288,7 +288,7 @@ class FlutterVESDK: FlutterIMGLY() {
288288
this.result?.success(null)
289289
this.result = null
290290
} catch (e: AuthorizationException) {
291-
this.result?.error("VE.SDK", "The license is invalid.", e.message)
291+
this.result?.error(IMGLYConstants.K_ERROR_UNABLE_TO_UNLOCK, "The license is invalid.", e.message)
292292
this.result = null
293293
}
294294
}

example/ios/Podfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- imgly_sdk (2.9.0):
3+
- imgly_sdk (3.0.0):
44
- Flutter
55
- imglyKit (~> 11.4)
66
- imglyKit (11.5.1)
7-
- video_editor_sdk (2.9.0):
7+
- video_editor_sdk (3.0.0):
88
- Flutter
9-
- imgly_sdk (= 2.9.0)
9+
- imgly_sdk (= 3.0.0)
1010

1111
DEPENDENCIES:
1212
- Flutter (from `Flutter`)
@@ -27,9 +27,9 @@ EXTERNAL SOURCES:
2727

2828
SPEC CHECKSUMS:
2929
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
30-
imgly_sdk: a1937f3cd410756297d87d15086a37f24466d288
30+
imgly_sdk: a114555e1d98e4a4fa5cc8f2b258353198c64e8b
3131
imglyKit: b1b3b827799a50b090433ca7c61f90b078944898
32-
video_editor_sdk: 2e3a8cbe6f1f09a8e12ba7cbac6f2bd7793bada5
32+
video_editor_sdk: f113d4a2fc8838fdeee99a8461fb4c55ba6b9e3f
3333

3434
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
3535

ios/Classes/FlutterVESDK.swift

+15-13
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
4040
guard let arguments = call.arguments as? IMGLYDictionary else { return }
4141

4242
if self.result != nil {
43-
result(FlutterError(code: "Multiple requests.", message: "Cancelled due to multiple requests.", details: nil))
43+
result(FlutterError(code: IMGLYConstants.kErrorMultipleRequests, message: "Cancelled due to multiple requests.", details: nil))
4444
return
4545
}
4646

@@ -84,15 +84,15 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
8484
if valid == true {
8585
video = Video(segments: assets)
8686
} else {
87-
result(FlutterError(code: "Invalid video size: width and height must be greater than zero.", message: nil, details: nil))
87+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "Invalid video size: width and height must be greater than zero.", details: nil))
8888
return
8989
}
9090
}
9191
} else {
9292
if let videoSize = size {
9393
video = Video(size: videoSize)
9494
} else {
95-
result(FlutterError(code: "A video composition without assets must have a specific size.", message: nil, details: nil))
95+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "A video composition without assets must have a specific size.", details: nil))
9696
return
9797
}
9898
}
@@ -113,15 +113,15 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
113113
if valid == true {
114114
video = Video(segments: resolvedSegments)
115115
} else {
116-
result(FlutterError(code: "Invalid video size: width and height must be greater than zero.", message: nil, details: nil))
116+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "Invalid video size: width and height must be greater than zero.", details: nil))
117117
return
118118
}
119119
}
120120
} else {
121121
if let videoSize = size {
122122
video = Video(size: videoSize)
123123
} else {
124-
result(FlutterError(code: "A video composition without assets must have a specific size.", message: nil, details: nil))
124+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "A video composition without assets must have a specific size.", details: nil))
125125
return
126126
}
127127
}
@@ -134,13 +134,13 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
134134
video = Video(size: videoSize)
135135
}
136136
guard let finalVideo = video else {
137-
result(FlutterError(code: "Could not load video.", message: nil, details: nil))
137+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "Could not load video.", details: nil))
138138
return
139139
}
140140

141141
self.present(video: finalVideo, configuration: configuration, serialization: serialization)
142142
} else {
143-
result(FlutterError(code: "The video must not be null.", message: nil, details: nil))
143+
result(FlutterError(code: IMGLYConstants.kErrorUnableToLoad, message: "The video must not be null.", details: nil))
144144
return
145145
}
146146
}
@@ -185,9 +185,11 @@ public class FlutterVESDK: FlutterIMGLY, FlutterPlugin, VideoEditViewControllerD
185185
DispatchQueue.main.async {
186186
do {
187187
try VESDK.unlockWithLicense(from: url)
188+
self.result?(nil)
188189
self.result = nil
189190
} catch let error {
190-
self.handleLicenseError(with: error as NSError)
191+
self.result?(FlutterError(code: IMGLYConstants.kErrorUnableToUnlock, message: "Unlocking the SDK failed due to:", details: error.localizedDescription))
192+
self.result = nil
191193
}
192194
}
193195
}
@@ -253,26 +255,26 @@ extension FlutterVESDK {
253255

254256
if self.serializationEnabled == true {
255257
guard let serializationData = videoEditViewController.serializedSettings else {
256-
self.handleError(videoEditViewController, code: "Serialization failed.", message: "No serialization data found.", details: nil)
258+
self.handleError(videoEditViewController, code: IMGLYConstants.kErrorUnableToExport, message: "No serialization data found.", details: nil)
257259
return
258260
}
259261
if self.serializationType == IMGLYConstants.kExportTypeFileURL {
260262
guard let exportURL = self.serializationFile else {
261-
self.handleError(videoEditViewController, code: "Serialization failed.", message: "The URL must not be nil.", details: nil)
263+
self.handleError(videoEditViewController, code: IMGLYConstants.kErrorUnableToExport, message: "The URL must not be nil.", details: nil)
262264
return
263265
}
264266
do {
265267
try serializationData.IMGLYwriteToUrl(exportURL, andCreateDirectoryIfNeeded: true)
266268
serialization = self.serializationFile?.absoluteString
267269
} catch let error {
268-
self.handleError(videoEditViewController, code: "Serialization failed.", message: error.localizedDescription, details: error.localizedDescription)
270+
self.handleError(videoEditViewController, code: IMGLYConstants.kErrorUnableToExport, message: error.localizedDescription, details: error.localizedDescription)
269271
return
270272
}
271273
} else if self.serializationType == IMGLYConstants.kExportTypeObject {
272274
do {
273275
serialization = try JSONSerialization.jsonObject(with: serializationData, options: .init(rawValue: 0))
274276
} catch let error {
275-
self.handleError(videoEditViewController, code: "Serialization failed.", message: error.localizedDescription, details: error.localizedDescription)
277+
self.handleError(videoEditViewController, code: IMGLYConstants.kErrorUnableToExport, message: error.localizedDescription, details: error.localizedDescription)
276278
return
277279
}
278280
}
@@ -294,7 +296,7 @@ extension FlutterVESDK {
294296
/// - Parameter videoEditViewController: The `VideoEditViewController` that failed to export the video.
295297
/// - Parameter error: The `VideoEditorError` that caused the failure.
296298
public func videoEditViewControllerDidFail(_ videoEditViewController: VideoEditViewController, error: VideoEditorError) {
297-
self.handleError(videoEditViewController, code: "Editor failed", message: "The editor did fail to generate the video.", details: error.localizedDescription)
299+
self.handleError(videoEditViewController, code: IMGLYConstants.kErrorUnableToExport, message: "The editor did fail to generate the video.", details: error.localizedDescription)
298300
}
299301

300302
/// Called if the `VideoEditViewController` was cancelled.

lib/video_editor_sdk.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class VESDK {
1717
/// to include one license for each platform with the same name, but where
1818
/// the iOS license has `.ios` as its file extension and the
1919
/// Android license has `.android` as its file extension.
20-
static void unlockWithLicense(String path) async {
21-
await _channel.invokeMethod('unlock', <String, dynamic>{'license': path});
20+
static Future<void> unlockWithLicense(String path) async {
21+
return _channel.invokeMethod('unlock', <String, dynamic>{'license': path});
2222
}
2323

2424
/// Opens a new video editor.

pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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.9.0
4-
homepage: https://www.videoeditorsdk.com
3+
version: 3.0.0
4+
homepage: https://img.ly/products/video-sdk
55
repository: https://github.com/imgly/vesdk-flutter
66

77
environment:
@@ -11,7 +11,7 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
imgly_sdk: 2.9.0
14+
imgly_sdk: 3.0.0
1515

1616
dev_dependencies:
1717
flutter_test:

test/video_editor_sdk_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
22
import 'package:flutter_test/flutter_test.dart';
33

44
void main() {
5-
const MethodChannel channel = MethodChannel('video_editor_sdk');
5+
const channel = MethodChannel('video_editor_sdk');
66

77
TestWidgetsFlutterBinding.ensureInitialized();
88

0 commit comments

Comments
 (0)