Skip to content

Commit

Permalink
Add version 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leontobias committed Mar 27, 2024
1 parent 4fef6e4 commit eeede47
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 49 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down Expand Up @@ -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.
Expand Down
17 changes: 2 additions & 15 deletions hooks/copy-imglyConfig-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
8 changes: 6 additions & 2 deletions hooks/dependencies-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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 +
Expand Down
3 changes: 1 addition & 2 deletions hooks/imglyConfig-gradle-hook.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion hooks/repositories-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
});
Expand Down
4 changes: 2 additions & 2 deletions 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.3.0",
"version": "3.4.0",
"types": "./types/index.d.ts",
"main": "www/videoeditorsdk.js",
"scripts": {
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?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.3.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.4.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>
<keywords>cordova,cordova-android,cordova-ios,video,video editor,videoeditor,videoeditorsdk,VideoEditor SDK,SDK,ios,android</keywords>
<repo>https://github.com/imgly/vesdk-cordova.git</repo>
<author>img.ly GmbH, contact@img.ly</author>
<author>IMG.LY GmbH, contact@img.ly</author>

<engines>
<engine name="cordova" version=">=9.0.0"/>
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.30"/>
<pod name="VideoEditorSDK" spec="~> 11.8"/>
</pods>
</podspec>
</platform>
Expand Down
2 changes: 1 addition & 1 deletion src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply plugin: 'ly.img.android.sdk'
apply plugin: 'kotlin-android'

// Configure the VESDKPlugin
imglyConfig {
IMGLY.predefine {
vesdk {
enabled true
}
Expand Down
37 changes: 16 additions & 21 deletions src/ios/VESDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -405,34 +405,41 @@ - (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];
}
}

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];

Expand All @@ -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)
Expand Down

0 comments on commit eeede47

Please sign in to comment.