Skip to content

Commit

Permalink
Add version 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leontobias committed Jun 2, 2022
1 parent 27fe4d0 commit 729d5c9
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 55 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [2.5.0]

### Added

* [imgly_sdk] Added `ThemeOptions` which enable customizing the UI color scheme with existing or custom runtime `Theme`s on iOS and existing or custom compiletime XML themes on Android.
* [imgly_sdk] Added `Configuration.toolbarMode` which enables repositioning the toolbar to the top/bottom of the editor on iOS.
* [video_editor_sdk] Added implementation and documentation for GIPHY sticker integration.

### Fixed

* Fixed enabling serialization would potentially crash the export on Android.
* [imgly_sdk] Fixed error when running on Android with Flutter 3.
* [photo_editor_sdk] Fixed error when opening the editor without an image but with a serialization with an embedded image.
* [video_editor_sdk] Fixed height and width of specified composition size would be flipped on Android.

## [2.4.0]

### Changed
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add the plugin package to the `pubspec.yaml` file in your project:

```yaml
dependencies:
video_editor_sdk: ^2.4.0
video_editor_sdk: ^2.5.0
```
Install the new dependency:
Expand All @@ -34,7 +34,7 @@ flutter pub get

### Known Issues

With version `2.4.0`, we recommend using `compileSdkVersion` not lower than `31.0.0` for Android. However, this might interfere with your application's Android Gradle Plugin version if this is set to `4.x`.
With version `2.4.0`, we recommend using `compileSdkVersion` not lower than `31` for Android. However, this might interfere with your application's Android Gradle Plugin version if this is set to `4.x`.

If you don't use a newer Android Gradle Plugin version you'll most likely encounter a build error similar to:
```
Expand Down Expand Up @@ -95,12 +95,12 @@ Run with --stacktrace option to get the stack trace. Run with --info or --debug
}
dependencies {
...
+ classpath 'ly.img.android.sdk:plugin:10.0.1'
+ classpath 'ly.img.android.sdk:plugin:10.1.1'
...
}
}
```
In order to update VideoEditor SDK for Android replace the version string `10.0.1` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
In order to update VideoEditor SDK for Android replace the version string `10.1.1` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).

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

Expand Down Expand Up @@ -171,6 +171,7 @@ Run with --stacktrace option to get the stack trace. Run with --info or --debug
include 'ui:video-library'
include 'ui:video-composition'
include 'ui:audio-composition'
include 'ui:giphy-sticker'

// This module is big, remove the serializer if you don't need that feature.
include 'backend:serializer'
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ imglyConfig {
}
}

def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.0.1"
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.1.1"

task checkVersion {
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.app.Activity
import androidx.annotation.NonNull
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.util.Log

import io.flutter.embedding.engine.plugins.FlutterPlugin
Expand All @@ -23,6 +22,7 @@ import ly.img.android.sdk.config.*
import ly.img.android.pesdk.backend.encoder.Encoder
import ly.img.android.pesdk.backend.model.EditorSDKResult
import ly.img.android.pesdk.backend.model.state.VideoCompositionSettings
import ly.img.android.pesdk.utils.ThreadUtils
import ly.img.android.serializer._3.IMGLYFileWriter

import org.json.JSONObject
Expand Down Expand Up @@ -50,7 +50,7 @@ class FlutterVESDK: FlutterIMGLY() {

override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (this.result != null) {
result?.error("Multiple requests.", "Cancelled due to multiple requests.", null)
result.error("Multiple requests.", "Cancelled due to multiple requests.", null)
return
}

Expand Down Expand Up @@ -78,7 +78,7 @@ class FlutterVESDK: FlutterIMGLY() {
this.present(videos, config, serialization, size)
}
} else {
result.error("VESDK", "The video must not be null", null)
result.error("VE.SDK", "The video must not be null", null)
}
} else if (call.method == "unlock") {
val license = call.argument<String>("license")
Expand Down Expand Up @@ -129,7 +129,7 @@ class FlutterVESDK: FlutterIMGLY() {
if (videos != null && videos.count() > 0) {
if (source == null) {
if (size != null) {
result?.error("VESDK", "Invalid video size: width and height must be greater than zero.", null)
result?.error("VE.SDK", "Invalid video size: width and height must be greater than zero.", null)
this.result = null
return
}
Expand All @@ -145,7 +145,7 @@ class FlutterVESDK: FlutterIMGLY() {
}
} else {
if (source == null) {
result?.error("VESDK", "A video composition without assets must have a specific size.", null)
result?.error("VE.SDK", "A video composition without assets must have a specific size.", null)
this.result = null
return
}
Expand All @@ -155,6 +155,8 @@ class FlutterVESDK: FlutterIMGLY() {
it.source = source
}

applyTheme(settingsList, configuration.theme)

readSerialisation(settingsList, serialization, false)
startEditor(settingsList, EDITOR_RESULT_ID)
}
Expand All @@ -178,7 +180,7 @@ class FlutterVESDK: FlutterIMGLY() {
if (height == 0.0 || width == 0.0) {
return null
}
return LoadSettings.compositionSource(height.toInt(), width.toInt(), 60)
return LoadSettings.compositionSource(width.toInt(), height.toInt(), 60)
}

/**
Expand All @@ -193,7 +195,7 @@ class FlutterVESDK: FlutterIMGLY() {
this.result?.success(null)
this.result = null
} catch (e: AuthorizationException) {
this.result?.error("Invalid license", "The license must be valid.", e.message)
this.result?.error("VE.SDK", "The license is invalid.", e.message)
this.result = null
}
}
Expand All @@ -212,46 +214,45 @@ class FlutterVESDK: FlutterIMGLY() {
}
return true
} else if (resultCode == Activity.RESULT_OK && requestCode == EDITOR_RESULT_ID) {
val serializationConfig = currentConfig?.export?.serialization
val resultUri = intentData.resultUri
val sourceUri = intentData.sourceUri
ThreadUtils.runAsync {
val serializationConfig = currentConfig?.export?.serialization
val resultUri = intentData.resultUri
val sourceUri = intentData.sourceUri

var serialization: Any? = null
if (serializationConfig?.enabled == true) {
val settingsList = intentData.settingsList
skipIfNotExists {
settingsList.let { settingsList ->
if (serializationConfig.embedSourceImage == true) {
Log.i("ImglySDK", "EmbedSourceImage is currently not supported by the Android SDK")
}
serialization = when (serializationConfig.exportType) {
SerializationExportType.FILE_URL -> {
val uri = serializationConfig.filename?.let {
Uri.parse("$it.json")
} ?: Uri.fromFile(File.createTempFile("serialization-" + UUID.randomUUID().toString(), ".json"))
Encoder.createOutputStream(uri).use { outputStream ->
IMGLYFileWriter(settingsList).writeJson(outputStream)
var serialization: Any? = null
if (serializationConfig?.enabled == true) {
val settingsList = intentData.settingsList
skipIfNotExists {
settingsList.let { settingsList ->
serialization = when (serializationConfig.exportType) {
SerializationExportType.FILE_URL -> {
val uri = serializationConfig.filename?.let {
Uri.parse("$it.json")
} ?: Uri.fromFile(File.createTempFile("serialization-" + UUID.randomUUID().toString(), ".json"))
Encoder.createOutputStream(uri).use { outputStream ->
IMGLYFileWriter(settingsList).writeJson(outputStream)
}
uri.toString()
}
SerializationExportType.OBJECT -> {
jsonToMap(JSONObject(IMGLYFileWriter(settingsList).writeJsonAsString()))
}
uri.toString()
}
SerializationExportType.OBJECT -> {
jsonToMap(JSONObject(IMGLYFileWriter(settingsList).writeJsonAsString()))
}
}
settingsList.release()
} ?: run {
Log.e("IMG.LY SDK", "You need to include 'backend:serializer' Module, to use serialisation!")
}
settingsList.release()
} ?: run {
Log.i("ImglySDK", "You need to include 'backend:serializer' Module, to use serialisation!")
}
}

val map = mutableMapOf<String, Any?>()
map["video"] = resultUri.toString()
map["hasChanges"] = (sourceUri?.path != resultUri?.path)
map["serialization"] = serialization
currentActivity?.runOnUiThread {
this.result?.success(map)
this.result = null
val map = mutableMapOf<String, Any?>()
map["video"] = resultUri.toString()
map["hasChanges"] = (sourceUri?.path != resultUri?.path)
map["serialization"] = serialization
currentActivity?.runOnUiThread {
this.result?.success(map)
this.result = null
}
}
return true
}
Expand Down
1 change: 1 addition & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ imglyConfig {
include 'ui:video-library'
include 'ui:video-composition'
include 'ui:audio-composition'
include 'ui:giphy-sticker'

// This module is big, remove the serializer if you don't need that feature.
include 'backend:serializer'
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '1.5.32'
ext.vesdk_version = '10.0.1'
ext.vesdk_version = '10.1.1'

repositories {
google()
Expand Down
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PODS:
- Flutter (1.0.0)
- imgly_sdk (2.4.0):
- imgly_sdk (2.5.0):
- Flutter
- imglyKit (~> 10.29)
- imglyKit (10.30.0)
- video_editor_sdk (2.4.0):
- imglyKit (~> 10.30)
- imglyKit (10.30.1)
- video_editor_sdk (2.5.0):
- Flutter
- imgly_sdk

Expand All @@ -27,9 +27,9 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
imgly_sdk: 2d7b5dc391131eb2b7431333c6db1b515a77a578
imglyKit: d5f3091f9980b97728c05b4144513b139313d8d7
video_editor_sdk: 0f7aa0da4a0d737e75a5982244ae48c36127cfe9
imgly_sdk: d8f93e1cbb33f6c27d0ab8f88ccceeeb819ca60d
imglyKit: bb83829ba5d1af548772d61660556473f0391d1c
video_editor_sdk: b7a26ee9ead44774e7fac73392a03f6907e3e8d3

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
5 changes: 5 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class _MyAppState extends State<MyApp> {
Sticker.existing("imgly_sticker_shapes_badge_01"),
Sticker.existing("imgly_sticker_shapes_arrow_02")
]);

/// A GIPHY sticker category.
// final giphy = StickerCategory.giphy(
// GiphyStickerProvider("YOUR-GIPHY-API-KEY"));

var categories = <StickerCategory>[logos, emoticons, shapes];
final configuration = Configuration(
sticker:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: video_editor_sdk
description: The official Flutter plugin for VideoEditor SDK. Integrate the video editor into your own iOS or Android app - in minutes!
version: 2.4.0
version: 2.5.0
homepage: https://www.videoeditorsdk.com
repository: https://github.com/imgly/vesdk-flutter

Expand All @@ -11,7 +11,7 @@ environment:
dependencies:
flutter:
sdk: flutter
imgly_sdk: 2.4.0
imgly_sdk: 2.5.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 729d5c9

Please sign in to comment.