From eeede473899bae9e529d822eee731747fe5b47fb Mon Sep 17 00:00:00 2001 From: Leon Dudlik Date: Wed, 27 Mar 2024 11:22:24 +0100 Subject: [PATCH] Add version 3.4.0 --- CHANGELOG.md | 9 +++++++ LICENSE.md | 4 +-- README.md | 18 +++++++++++++ hooks/copy-imglyConfig-gradle-hook.js | 17 ++---------- hooks/dependencies-gradle-hook.js | 8 ++++-- hooks/imglyConfig-gradle-hook.js | 3 +-- hooks/repositories-gradle-hook.js | 2 +- package.json | 4 +-- plugin.xml | 6 ++--- src/android/build.gradle | 2 +- src/ios/VESDKPlugin.m | 37 ++++++++++++--------------- 11 files changed, 61 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e9812..f7e9216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [3.4.0] + +### Changed + +* [Android] 🚨 With this version you will need to specify a suitable KSP depending on the Kotlin version you are using. Please visit our guide [here](https://github.com/imgly/vesdk-cordova/blob/master/README.md#ksp). +* [Android] Raised minimum VideoEditor SDK for Android version to 10.9.0. +* [iOS] 🚨 Bumped iOS deployment target to 13.0. +* [iOS] Raised minimum VideoEditor SDK for iOS version to 11.8. + ## [3.3.0] ### Added diff --git a/LICENSE.md b/LICENSE.md index d86fc14..8e7cc2c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,7 +4,7 @@ In order to run any samples or use any wrapper without a watermark, you'll have to purchase a commercial PhotoEditor SDK or VideoEditor SDK license. Visit https://img.ly for more details. -Copyright (c) 2014-2022, img.ly GmbH +Copyright (c) 2014-2024, IMG.LY GmbH All rights reserved. Redistribution and use in source and binary forms, with or without @@ -17,7 +17,7 @@ modification, are permitted provided that the following conditions are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. Neither the name img.ly GmbH, img.ly, PhotoEditor SDK, VideoEditor SDK +3. Neither the name IMG.LY GmbH, IMG.LY, PhotoEditor SDK, VideoEditor SDK nor the names of its developers may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/README.md b/README.md index 88b67a3..e8d0747 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,20 @@ You can configure the native Android VideoEditor SDK version used by creating a If no version / no configuration file is specified, the module will use the default minimum required version. +#### KSP + +With version `3.2.0` of the VideoEditor SDK for Cordova, the integration of the native Android VE.SDK has changed. The new minimum Android VE.SDK version is `10.9.0` which requires [Kotlin Symbol Processing (KSP)](https://github.com/google/ksp). +The KSP version depends on the Kotlin version that you are using. In order to find the correct version, please visit the [official KSP release page](https://github.com/google/ksp/releases?page=1). +In order to specify the KSP version, please add an entry to the `imglyConfig.json`: + +```json +{ + "kspVersion": "1.7.21-1.0.8" +} +``` + +By default, version `1.7.21-1.0.8` is used which is suitable for Kotlin `1.7.21`. + #### AndroidX From version `3.0.0` the plugin uses AndroidX. To enable AndroidX in your application please adjust your `config.xml`: @@ -109,6 +123,10 @@ Because VideoEditor SDK for Android with all its modules is quite large, there i cordova plugin add cordova-plugin-enable-multidex ``` +### iOS + +With version `3.4.0` the plugin requires a deployment target of 13.0+ for iOS. If needed, please update your deployment target inside the `config.xml` as described [here](https://cordova.apache.org/docs/en/latest/config_ref/index.html). + ### Usage Each platform requires a separate license file. Unlock VideoEditor SDK with a single line of code for both platforms via platform-specific file extensions. diff --git a/hooks/copy-imglyConfig-gradle-hook.js b/hooks/copy-imglyConfig-gradle-hook.js index 0441fa7..0023071 100644 --- a/hooks/copy-imglyConfig-gradle-hook.js +++ b/hooks/copy-imglyConfig-gradle-hook.js @@ -8,10 +8,6 @@ module.exports = (context) => { return new Promise((resolve, reject) => { const BLOCK_START = `// imglyConfig ADDED BY IMGLY - BLOCK START`; const BLOCK_END = `// imglyConfig ADDED BY IMGLY - BLOCK END`; - const imglyConfigHeader = ` -apply plugin: 'ly.img.android.sdk' -apply plugin: 'kotlin-android' -`; // The content of the gradle file in the cordova app root const projectRoot = path.join(context.opts.projectRoot); @@ -35,22 +31,13 @@ apply plugin: 'kotlin-android' gradleFiles, function (file, callback) { let fileContents = fs.readFileSync(file, "utf8"); - - let whereToAdd = fileContents.indexOf( - "// PLUGIN GRADLE EXTENSIONS START" - ); - fileContents = - fileContents.substr(0, whereToAdd) + + fileContents + BLOCK_START + - imglyConfigHeader + imglyConfig + - BLOCK_END + - "\n" + - fileContents.substr(whereToAdd); + BLOCK_END fs.writeFileSync(file, fileContents, "utf8"); console.log("updated " + file + " to include imglyConfig"); - callback(); }, function (err) { diff --git a/hooks/dependencies-gradle-hook.js b/hooks/dependencies-gradle-hook.js index d594394..c1e272c 100644 --- a/hooks/dependencies-gradle-hook.js +++ b/hooks/dependencies-gradle-hook.js @@ -9,8 +9,9 @@ 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.5.32'; - var sdkVersion = "10.1.1"; + const gradlePluginVersion = '1.7.21'; + var sdkVersion = "10.9.0"; + var kspVersion = "1.7.21-1.0.8"; try { const configFilePath = path.join( @@ -21,7 +22,9 @@ module.exports = (context) => { if (config != null) { const configJson = JSON.parse(config); const configVersion = configJson.version; + const configKspVersion = configJson.kspVersion; if (configVersion != null) sdkVersion = configVersion; + if (configKspVersion != null) kspVersion = configKspVersion; } } catch { console.log( @@ -33,6 +36,7 @@ module.exports = (context) => { "\n" + BLOCK_START + ` + classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:${kspVersion}" classpath "ly.img.android.sdk:plugin:${sdkVersion}"` + "\n" + BLOCK_END + diff --git a/hooks/imglyConfig-gradle-hook.js b/hooks/imglyConfig-gradle-hook.js index 4124211..bc6f3e9 100644 --- a/hooks/imglyConfig-gradle-hook.js +++ b/hooks/imglyConfig-gradle-hook.js @@ -1,13 +1,12 @@ const fs = require("fs"); const path = require("path"); -const async = require("async"); module.exports = (context) => { "use strict"; const imglyConfig = ` // Comment out the modules you don't need, to save size. -imglyConfig { +IMGLY.configure { modules { include 'ui:text' include 'ui:focus' diff --git a/hooks/repositories-gradle-hook.js b/hooks/repositories-gradle-hook.js index 6cdad71..a96a18e 100644 --- a/hooks/repositories-gradle-hook.js +++ b/hooks/repositories-gradle-hook.js @@ -88,7 +88,7 @@ module.exports = (context) => { fileContents = fileContents + "\n" + BLOCK_START + "\n" + `allprojects {\n repositories {\n ${mavenRepository}\n }\n}` + "\n" + BLOCK_END; } fs.writeFileSync(file, fileContents, "utf8"); - console.log("Updated " + file + " to include img.ly repositories."); + console.log("Updated " + file + " to include IMG.LY repositories."); return; }; }); diff --git a/package.json b/package.json index d094188..cf73445 100644 --- a/package.json +++ b/package.json @@ -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.3.0", + "version": "3.4.0", "types": "./types/index.d.ts", "main": "www/videoeditorsdk.js", "scripts": { @@ -34,7 +34,7 @@ }, "homepage": "https://www.videoeditorsdk.com", "author": { - "name": "img.ly GmbH", + "name": "IMG.LY GmbH", "email": "contact@img.ly" }, "license": "BSD-3-Clause", diff --git a/plugin.xml b/plugin.xml index 81ae11b..350d137 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,11 +1,11 @@ - + VideoEditorSDK A Cordova plugin for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes! BSD-3-Clause cordova,cordova-android,cordova-ios,video,video editor,videoeditor,videoeditorsdk,VideoEditor SDK,SDK,ios,android https://github.com/imgly/vesdk-cordova.git - img.ly GmbH, contact@img.ly + IMG.LY GmbH, contact@img.ly @@ -68,7 +68,7 @@ - + diff --git a/src/android/build.gradle b/src/android/build.gradle index d2e5850..3602621 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -9,7 +9,7 @@ apply plugin: 'ly.img.android.sdk' apply plugin: 'kotlin-android' // Configure the VESDKPlugin -imglyConfig { +IMGLY.predefine { vesdk { enabled true } diff --git a/src/ios/VESDKPlugin.m b/src/ios/VESDKPlugin.m index c704017..e8bfe91 100644 --- a/src/ios/VESDKPlugin.m +++ b/src/ios/VESDKPlugin.m @@ -405,25 +405,32 @@ - (void)dismiss:(nullable PESDKMediaEditViewController *)mediaEditViewController #pragma mark - PESDKPhotoEditViewControllerDelegate -// The PhotoEditViewController did save an image. -- (void)videoEditViewController:(PESDKVideoEditViewController *)videoEditViewController - didFinishWithVideoAtURL:(nullable NSURL *)url { +// The VideoEditViewController was cancelled. +- (void)videoEditViewControllerDidCancel:(PESDKVideoEditViewController *)videoEditViewController { + CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + [self closeControllerWithResult:result]; +} + +// The VideoEditViewController could not create the video. +- (void)videoEditViewControllerDidFail:(PESDKVideoEditViewController * _Nonnull)videoEditViewController error:(PESDKVideoEditorError * _Nonnull)error { + CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR + messageAsString:@"Unable to generate video."]; + [self closeControllerWithResult:result]; +} +// The VideoEditViewController did save an image. +- (void)videoEditViewControllerDidFinish:(PESDKVideoEditViewController * _Nonnull)videoEditViewController result:(PESDKVideoEditorResult * _Nonnull)result { NSError *error = nil; id serialization = nil; - if (self.serializationEnabled) { NSData *serializationData = [videoEditViewController serializedSettings]; - if ([self.serializationType isEqualToString:VESDK_IMGLY.kExportTypeFileURL]) { - if ([serializationData VESDK_IMGLY_writeToURL:self.serializationFile andCreateDirectoryIfNecessary:YES error:&error]) { serialization = self.serializationFile.absoluteString; } } else if ([self.serializationType isEqualToString:VESDK_IMGLY.kExportTypeObject]) { - serialization = [NSJSONSerialization JSONObjectWithData:serializationData options:kNilOptions error:&error]; } } @@ -431,8 +438,8 @@ - (void)videoEditViewController:(PESDKVideoEditViewController *)videoEditViewCon if (error == nil) { CDVPluginResult *resultAsync; NSDictionary *payload = [NSDictionary - dictionaryWithObjectsAndKeys:(url != nil) ? url.absoluteString : [NSNull null], @"video", - @(videoEditViewController.hasChanges), @"hasChanges", + dictionaryWithObjectsAndKeys:(result.output.url != nil) ? result.output.url.absoluteString : [NSNull null], @"video", + @(result.status == VESDKVideoEditorStatusRenderedWithChanges), @"hasChanges", (serialization != nil) ? serialization : [NSNull null], @"serialization", nil]; resultAsync = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:payload]; @@ -444,18 +451,6 @@ - (void)videoEditViewController:(PESDKVideoEditViewController *)videoEditViewCon } } -// The VideoEditViewController was cancelled. -- (void)videoEditViewControllerDidCancel:(PESDKVideoEditViewController *)videoEditViewController { - CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self closeControllerWithResult:result]; -} - -// The VideoEditViewController could not create an image. -- (void)videoEditViewControllerDidFailToGenerateVideo:(PESDKVideoEditViewController *)videoEditViewController { - CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR - messageAsString:@"Unable to generate video."]; - [self closeControllerWithResult:result]; -} @end @implementation NSDictionary (VESDK_IMGLY_Category)