Skip to content

Commit

Permalink
Add version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leontobias committed Oct 17, 2022
1 parent d67bcd1 commit c13a3cb
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 30 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## [3.2.0]

### Changed

* 🚨 With this version you might need to create symlinks when using Android Gradle Plugin version `4.x`. Please refer to the new [known issues](https://github.com/imgly/vesdk-cordova#known-issues) section of the README for details.
* 🚨 This version requires `minSdkVersion` `21` for Android. Please refer to the new "Supported Android versions" section in the [getting started](https://github.com/imgly/vesdk-cordova#android) section of the README for instructions on how to adjust it.
* Raised minimum VideoEditor SDK for Android version to 10.1.1. See the [changelog](https://github.com/imgly/vesdk-android-demo/blob/master/CHANGELOG.md) for more information.

### Added

* Added implementation and documentation for GIPHY sticker integration.

### Fixed

* Fixed `VESDK.openEditor` `success` callback type declaration to return `VideoEditorResult | null` instead of just `VideoEditorResult`.
* [Android] Fixed height and width of specified composition size would be flipped.

## [3.1.0]

### Changed
Expand Down
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ Add VideoEditor SDK plugin to your project as follows:
cordova plugin add cordova-plugin-videoeditorsdk
```

### Known Issues

With version `3.2.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:
```
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':cordova-plugin-videoeditorsdk'.
> com.android.builder.errors.EvalIssueException: Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
```
As a workaround you can create the following symlinks:
1. Inside `/Users/YOUR-USERNAME/Library/Android/sdk/build-tools/31.0.0/`: Create a `dx` symlink for the `d8` file with `ln -s d8 dx`.
2. From there, go to `./lib/` and create a `dx.jar` symlink for the `d8.jar` file with `ln -s d8.jar dx.jar`.

### Android

From version `3.0.0` the plugin uses AndroidX. To enable AndroidX in your application please adjust your `config.xml`:
Expand All @@ -36,16 +57,31 @@ If your application is using legacy Android Support Libraries you can use the [`

#### Kotlin Version

If you are using `Cordova Android` version `10.+`, you might need to adjust the Kotlin version of your application in your `config.xml`, if your current Kotlin version is not compatible with our plugin:
If you are using `cordova-android` version `10.+`, you might need to adjust the Kotlin version of your application in your `config.xml`, if your current Kotlin version is not compatible with our plugin:

```diff
<platform name="android">
...
+ <preference name="GradlePluginKotlinVersion" value="1.4.10" />
+ <preference name="GradlePluginKotlinVersion" value="1.5.32" />
...
</platform>
```

#### Supported Android versions

With version `3.2.0` the plugin requires `minSdkVersion` `21` or higher. Depending on your `cordova-android` version you might need to raise the `minSdkVersion` manually. For this, please add the following entry to your `config.xml`:

```diff
<platform name="android">
...
+ <preference name="android-minSdkVersion" value="21" />
...
</platform>
```

We further recommend you to update your `buildToolsVersion` to `31.0.0` as well as your `compileSdkVersion` to `31`. However, this is not mandatory. For further reference on how to update these variables, please refer to the official [Cordova documentation](https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html#configuring-gradle).


#### Module Configuration

You can configure the modules used for the VideoEditor SDK for Android by opening `imglyConfig.gradle` and removing / commenting out the modules you do not need. This will also reduce the size of your application.
Expand Down
4 changes: 2 additions & 2 deletions hooks/dependencies-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ module.exports = (context) => {
const BLOCK_END = ` // DEPENDENCIES ADDED BY IMGLY - BLOCK END`;
const VERSION_BLOCK_START = "// VERSION CHANGED BY IMGLY - START - ";
const VERSION_BLOCK_END = "// VERSION CHANGED BY IMGLY - END -";
const gradlePluginVersion = '1.4.10';
const gradlePluginVersion = '1.5.32';

const imglyDependencies =
"\n" +
BLOCK_START +
`
classpath "ly.img.android.sdk:plugin:9.2.0"` +
classpath "ly.img.android.sdk:plugin:10.1.1"` +
"\n" +
BLOCK_END +
"\n";
Expand Down
1 change: 1 addition & 0 deletions hooks/imglyConfig-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ imglyConfig {
include 'ui:video-composition' // for VideoEditor
include 'ui:video-library' // for VideoEditor
include 'ui:audio-composition' // for VideoEditor
include 'ui:giphy-sticker' // for VideoEditor
// 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 package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-videoeditorsdk",
"description": "A Cordova plugin for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes!",
"version": "3.1.0",
"version": "3.2.0",
"types": "./types/index.d.ts",
"main": "www/videoeditorsdk.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-videoeditorsdk" version="3.1.0">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-videoeditorsdk" version="3.2.0">
<name>VideoEditorSDK</name>
<description>A Cordova plugin for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes!</description>
<license>BSD-3-Clause</license>
Expand Down Expand Up @@ -68,7 +68,7 @@
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="VideoEditorSDK" spec="~> 10.29"/>
<pod name="VideoEditorSDK" spec="~> 10.30"/>
</pods>
</podspec>
</platform>
Expand Down
28 changes: 12 additions & 16 deletions src/android/VESDKPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class VESDKPlugin : CordovaPlugin() {
/** The callback used for the plugin. */
private var callback: CallbackContext? = null

/** The currently used settings list. */
private var currentSettingsList: VideoEditorSettingsList? = null

/** The currently used configuration. */
private var currentConfig: Configuration? = null

Expand Down Expand Up @@ -121,12 +118,10 @@ class VESDKPlugin : CordovaPlugin() {
) {
callback = callbackContext
IMGLY.authorize()
val settingsList = VideoEditorSettingsList()

currentSettingsList = settingsList
currentConfig = ConfigLoader.readFrom(config).also {
it.applyOn(settingsList)
}
val configuration = ConfigLoader.readFrom(config)
val settingsList = VideoEditorSettingsList(configuration.export?.serialization?.enabled == true)
configuration.applyOn(settingsList)
currentConfig = configuration

settingsList.configure<LoadSettings> { loadSettings ->
loadSettings.source = retrieveURI(filepath)
Expand Down Expand Up @@ -154,15 +149,14 @@ class VESDKPlugin : CordovaPlugin() {
) {
callback = callbackContext
IMGLY.authorize()
val settingsList = VideoEditorSettingsList()

// Set the video size as the default source.
var source = resolveSize(size)

currentSettingsList = settingsList
currentConfig = ConfigLoader.readFrom(config).also {
it.applyOn(settingsList)
}
val configuration = ConfigLoader.readFrom(config)
val settingsList = VideoEditorSettingsList(configuration.export?.serialization?.enabled == true)
configuration.applyOn(settingsList)
currentConfig = configuration

if (videos != null && videos.count() > 0) {
if (source == null) {
Expand Down Expand Up @@ -204,6 +198,7 @@ class VESDKPlugin : CordovaPlugin() {
EditorBuilder(currentActivity)
.setSettingsList(settingsList)
.startActivityForResult(currentActivity, EDITOR_RESULT_ID, arrayOfNulls(0))
settingsList.release()
}()
}

Expand Down Expand Up @@ -236,7 +231,7 @@ class VESDKPlugin : CordovaPlugin() {
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 @@ -255,9 +250,9 @@ class VESDKPlugin : CordovaPlugin() {
val resultPath = data.resultUri

val serializationConfig = currentConfig?.export?.serialization
val settingsList = data.settingsList

val serialization: Any? = if (serializationConfig?.enabled == true) {
val settingsList = data.settingsList
skipIfNotExists {
settingsList.let { settingsList ->
if (serializationConfig.embedSourceImage == true) {
Expand All @@ -282,6 +277,7 @@ class VESDKPlugin : CordovaPlugin() {
Log.i("ImgLySdk", "You need to include 'backend:serializer' Module, to use serialisation!")
null
}
settingsList.release()
} else {
null
}
Expand Down
10 changes: 5 additions & 5 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ imglyConfig {
}
}

def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "9.1.0"
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.1.1"

task checkVESDKVersion {
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {
Expand All @@ -41,11 +41,11 @@ task checkVESDKVersion {
preBuild.dependsOn checkVESDKVersion

android {
compileSdkVersion safeExtGet('compileSdkVersion', 29)
buildToolsVersion safeExtGet('buildToolsVersion', '29.0.2')
compileSdkVersion safeExtGet('compileSdkVersion', 31)
buildToolsVersion safeExtGet('buildToolsVersion', '31.0.0')

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 19)
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 29)
}
lintOptions {
Expand All @@ -62,7 +62,7 @@ repositories {
}

dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10'
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32'
compileOnly "ly.img.android.sdk:serializer:$imglyConfig.version"
implementation 'com.google.code.gson:gson:2.8.5'
}
34 changes: 33 additions & 1 deletion types/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ export interface Configuration {
* ]},
* ]
*/
categories?: (StickerCategory | ExistingStickerCategory)[];
categories?: (StickerCategory | ExistingStickerCategory | ExistingStickerProviderCategory)[];
/**
* Defines all available colors that can be applied to stickers with a `tintMode` other than `TintMode.NONE`.
* The color pipette is always added.
Expand Down Expand Up @@ -1567,6 +1567,38 @@ export interface StickerCategory extends NamedItem {
items?: (Sticker | ExistingItem)[];
}

/** An existing sticker provider category. */
export interface ExistingStickerProviderCategory extends ExistingItem {
/**
* The used sticker provider that must match the category's identifier.
*/
provider: GiphyStickerProvider;
}

/**
* A GIPHY sticker provider.
* @note This sticker provider requires to use the identifier `imgly_sticker_category_giphy` for its `ExistingStickerProviderCategory`.
*/
export interface GiphyStickerProvider {
/**
* The key used to authorize API requests, obtained from GIPHY.
*/
apiKey: string;
/**
* The default language for regional content in 2-letter ISO 639-1 language code.
* If `null` the language setting of the current locale is used.
* @example // Defaults to:
* null
*/
language?: string;
/**
* The audience category used for content filtering. Available values are `"g"`, `"pg"`, `"pg-13"`, `"r"`.
* @example // Defaults to:
* "g"
*/
rating?: string;
}

/** A sticker. */
export interface Sticker extends NamedItem {
/**
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ declare class VESDK {
* be fitted to the `videoSize` aspect by adding black bars on the left and right side or top and bottom.
*/
static openEditor(
success: (args: VideoEditorResult) => void,
success: (args: VideoEditorResult | null) => void,
failure: (error: any) => void,
video: string,
configuration?: Configuration,
Expand Down

0 comments on commit c13a3cb

Please sign in to comment.