Skip to content

Commit 159561e

Browse files
committed
Add version 2.16.0
1 parent 6722946 commit 159561e

8 files changed

Lines changed: 70 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2.16.0]
2+
3+
### Added
4+
5+
* [react-native-videoeditorsdk] Added duration action for text and stickers.
6+
* [react-native-videoeditorsdk] Added `VideoEditorResult.segments`, `VideoEditorResult.videoSize`, and `VideoEditorResult.release()` which enable serialization of the individual video composition components if `configuration.export.video.segments` is enabled.
7+
18
## [2.15.0]
29

310
### Changed

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Check out our [video tutorial](https://img.ly/blog/a-photo-and-video-editor-for-
3232
With version `2.13.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`.
3333

3434
If you don't use a newer Android Gradle Plugin version, e.g., by updating at least to RN 0.68.0, you'll most likely encounter a build error similar to:
35+
3536
```
3637
FAILURE: Build failed with an exception.
3738
@@ -44,9 +45,11 @@ Run with --stacktrace option to get the stack trace. Run with --info or --debug
4445
4546
* Get more help at https://help.gradle.org
4647
```
48+
4749
As a workaround you can create the following symlinks:
48-
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`.
49-
2. From there, go to `./lib/` and create a `dx.jar` symlink for the `d8.jar` file with `ln -s d8.jar dx.jar`.
50+
51+
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`.
52+
2. From there, go to `./lib/` and create a `dx.jar` symlink for the `d8.jar` file with `ln -s d8.jar dx.jar`.
5053

5154
### Expo CLI
5255

@@ -63,7 +66,7 @@ In order to use this module with the Expo CLI you can make use of our integrated
6366
```sh
6467
expo install react-native-photoeditorsdk
6568
```
66-
69+
6770
This will automatically install [`react-native-imglysdk`](https://npmjs.org/package/react-native-imglysdk) which you can use to configure your application with our Expo config plugin.
6871

6972
2. Inside your app's `app.json` or `app.config.js` add our config plugin:
@@ -83,7 +86,7 @@ In order to use this module with the Expo CLI you can make use of our integrated
8386
"react-native-imglysdk",
8487
{
8588
"android": {
86-
"version": "10.1.1",
89+
"version": "10.4.0",
8790
"modules": [
8891
"ui:core",
8992
"ui:transform",
@@ -103,7 +106,7 @@ In order to use this module with the Expo CLI you can make use of our integrated
103106
```
104107

105108
For further information on the available modules, please refer to step 4 of the React Native CLI [Android](#android) guide below.
106-
109+
107110
**Please note that the `react-native-imglysdk` module manages both VideoEditor SDK as well as PhotoEditor SDK so you only need to add the Expo config plugin once even when using both SDKs.**
108111

109112
3. From version `2.15.0` the iOS deployment target needs to be set to at least iOS 13. You can use the `expo-build-properties` config plugin for this. Please refer to the [official Expo docs](https://docs.expo.dev/versions/v45.0.0/sdk/build-properties/).
@@ -149,6 +152,7 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
149152
#### Android
150153

151154
1. Add the img.ly repository and plugin by opening the `android/build.gradle` file (**not** `android/app/build.gradle`) and adding these lines at the top:
155+
152156
```groovy
153157
buildscript {
154158
repositories {
@@ -157,11 +161,12 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
157161
}
158162
dependencies {
159163
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.32"
160-
classpath 'ly.img.android.sdk:plugin:10.1.1'
164+
classpath 'ly.img.android.sdk:plugin:10.4.0'
161165
}
162166
}
163167
```
164-
In order to update PhotoEditor SDK for Android replace the version string `10.1.1` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
168+
169+
In order to update PhotoEditor SDK for Android replace the version string `10.4.0` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
165170

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

@@ -189,7 +194,8 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
189194
}
190195
```
191196

192-
4. Configure PhotoEditor SDK for Android by opening the `android/app/build.gradle` file (**not** `android/build.gradle`) and adding the following lines under `apply plugin: "com.android.application"`:
197+
4. Configure PhotoEditor SDK for Android by opening the `android/app/build.gradle` file (**not** `android/build.gradle`) and adding the following lines under `apply plugin: "com.android.application"`:
198+
193199
```groovy
194200
apply plugin: 'ly.img.android.sdk'
195201
apply plugin: 'kotlin-android'
@@ -230,25 +236,29 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
230236
Import the module in your `App.js`:
231237

232238
```js
233-
import {PESDK, PhotoEditorModal, Configuration} from 'react-native-photoeditorsdk';
239+
import {
240+
PESDK,
241+
PhotoEditorModal,
242+
Configuration,
243+
} from "react-native-photoeditorsdk";
234244
```
235245

236246
Each platform requires a separate license file. [Unlock PhotoEditor SDK](./index.d.ts#L41-L53) with a single line of code for both platforms via [platform-specific file extensions](https://reactnative.dev/docs/platform-specific-code#platform-specific-extensions):
237247

238248
```js
239-
PESDK.unlockWithLicense(require('./pesdk_license'));
249+
PESDK.unlockWithLicense(require("./pesdk_license"));
240250
```
241251

242252
Open the editor with an image:
243253

244254
```js
245-
PESDK.openEditor(require('./image.jpg'));
255+
PESDK.openEditor(require("./image.jpg"));
246256
```
247257

248258
Or use the component to open the editor:
249259

250260
```jsx
251-
<PhotoEditorModal visible={true} image={require('./image.jpg')}/>
261+
<PhotoEditorModal visible={true} image={require("./image.jpg")} />
252262
```
253263

254264
Please see the [code documentation](./index.d.ts) for more details and additional [customization and configuration options](./configuration.ts).

RNPhotoEditorSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
1818

1919
s.dependency 'React'
2020
s.dependency 'React-RCTImage'
21-
s.dependency 'PhotoEditorSDK', '~> 11.1'
21+
s.dependency 'PhotoEditorSDK', '~> 11.3'
2222
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ imglyConfig {
2020
}
2121
}
2222

23-
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.1.1"
23+
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.4.0"
2424

2525
task checkVersion {
2626
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {

configuration.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,9 @@ export interface Configuration {
606606
/**
607607
* Defines all allowed actions for the sticker tool menu. Only buttons for allowed actions are visible and shown in the given order.
608608
* @note The `StickerAction.REMOVE_BACKGROUND` action is only shown for personal and external (non-animated) stickers where a person could be detected. This feature is only supported on devices running iOS 15+.
609+
* @note The `StickerAction.DURATION` action is only shown when editing videos.
609610
* @example // Defaults to:
610-
* [StickerAction.REPLACE, StickerAction.OPACITY, StickerAction.COLOR, StickerAction.REMOVE_BACKGROUND]
611+
* [StickerAction.DURATION, StickerAction.REPLACE, StickerAction.OPACITY, StickerAction.COLOR, StickerAction.REMOVE_BACKGROUND]
611612
*/
612613
actions?: StickerAction[];
613614
/**
@@ -685,8 +686,9 @@ export interface Configuration {
685686
fonts?: (Font | ExistingItem)[];
686687
/**
687688
* Defines all allowed actions for the text tool menu. Only buttons for allowed actions are visible and shown in the given order.
689+
* @note The `TextAction.DURATION` action is only shown when editing videos.
688690
* @example // Defaults to:
689-
* [TextAction.FONT, TextAction.COLOR, TextAction.BACKGROUND_COLOR, TextAction.ALIGNMENT]
691+
* [TextAction.DURATION, TextAction.FONT, TextAction.COLOR, TextAction.BACKGROUND_COLOR, TextAction.ALIGNMENT]
690692
*/
691693
actions?: TextAction[];
692694
/**
@@ -1030,6 +1032,16 @@ export interface Configuration {
10301032
* null
10311033
*/
10321034
bitRate?: number | null;
1035+
/**
1036+
* Whether the video editor should include the video segments of the composition
1037+
* in the `VideoEditorResult`.
1038+
* @note If enabled, you need to release the result via `VideoEditorResult.release()`
1039+
* after processing the video segments in order to prevent memory leaks.
1040+
*
1041+
* @example // Defaults to:
1042+
* false
1043+
*/
1044+
segments?: boolean;
10331045
}
10341046
/**
10351047
* The filename for the exported data if the `exportType` is not `ImageExportType.DATA_URL`.
@@ -1313,6 +1325,7 @@ export enum StickerAction {
13131325
REPLACE = "replace",
13141326
OPACITY = "opacity",
13151327
REMOVE_BACKGROUND = "removebackground",
1328+
DURATION = "duration"
13161329
}
13171330

13181331
/** A text action. */
@@ -1321,6 +1334,7 @@ export enum TextAction {
13211334
COLOR = "color",
13221335
BACKGROUND_COLOR = "backgroundcolor",
13231336
ALIGNMENT = "alignment",
1337+
DURATION = "duration"
13241338
}
13251339

13261340
/** A frame action. */

ios/RNImglyKit.m

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ - (void)present:(nonnull IMGLYMediaEditViewControllerBlock)createMediaEditViewCo
8686
id valueSerializationType = [NSDictionary RN_IMGLY_dictionary:dictionary valueForKeyPath:@"export.serialization.exportType" default:RN_IMGLY.kExportTypeFileURL];
8787
id valueSerializationFile = [NSDictionary RN_IMGLY_dictionary:dictionary valueForKeyPath:@"export.serialization.filename" default:valueExportFile];
8888
id valueSerializationEmbedImage = [NSDictionary RN_IMGLY_dictionary:dictionary valueForKeyPath:@"export.serialization.embedSourceImage" default:@(NO)];
89+
id valueExportVideoSegments = [NSDictionary RN_IMGLY_dictionary:dictionary valueForKeyPath:@"export.video.segments" default:@(NO)];
8990

9091
NSString *exportType = [RCTConvert NSString:valueExportType];
9192
NSURL *exportFile = [RCTConvert RN_IMGLY_ExportFileURL:valueExportFile withExpectedUTI:getUTI(configuration)];
9293
BOOL serializationEnabled = [RCTConvert BOOL:valueSerializationEnabled];
9394
NSString *serializationType = [RCTConvert NSString:valueSerializationType];
9495
NSURL *serializationFile = [RCTConvert RN_IMGLY_ExportFileURL:valueSerializationFile withExpectedUTI:kUTTypeJSON];
9596
BOOL serializationEmbedImage = [RCTConvert BOOL:valueSerializationEmbedImage];
97+
BOOL exportVideoSegments = [RCTConvert BOOL:valueExportVideoSegments];
9698

9799
// Make sure that the export settings are valid
98100
if ((exportType == nil) ||
@@ -138,6 +140,7 @@ - (void)present:(nonnull IMGLYMediaEditViewControllerBlock)createMediaEditViewCo
138140
self.resolve = resolve;
139141
self.reject = reject;
140142
self.mediaEditViewController = mediaEditViewController;
143+
self.exportVideoSegments = exportVideoSegments;
141144

142145
UIViewController *currentViewController = RCTPresentedViewController();
143146
[currentViewController presentViewController:self.mediaEditViewController animated:YES completion:NULL];
@@ -159,6 +162,7 @@ - (void)dismiss:(nullable PESDKMediaEditViewController *)mediaEditViewController
159162
self.resolve = nil;
160163
self.reject = nil;
161164
self.mediaEditViewController = nil;
165+
self.exportVideoSegments = nil;
162166

163167
dispatch_async(dispatch_get_main_queue(), ^{
164168
[mediaEditViewController.presentingViewController dismissViewControllerAnimated:animated completion:completion];
@@ -351,22 +355,22 @@ + (nullable RN_IMGLY_ExportFileURL *)RN_IMGLY_ExportFileURL:(nullable id)json wi
351355

352356
+ (nullable RN_IMGLY_URLRequestArray *)RN_IMGLY_URLRequestArray:(nullable id)json
353357
{
354-
NSArray *array = [RCTConvert NSArray:json];
355-
NSMutableArray<NSURLRequest *> *requests = [NSMutableArray<NSURLRequest *> new];
356-
if (array.count == 0) { return [requests copy]; }
357-
for (id value in array) {
358-
if (value == (id)[NSNull null]) {
359-
RCTLogConvertError(json, @"a valid NSArray<NSURLRequest *>");
360-
return nil;
361-
}
362-
NSURLRequest *request = [RCTConvert NSURLRequest:value];
363-
if (request == nil) {
364-
RCTLogConvertError(value, @"a valid NSURLRequest");
365-
return nil;
366-
}
367-
[requests addObject:request];
358+
NSArray *array = [RCTConvert NSArray:json];
359+
NSMutableArray<NSURLRequest *> *requests = [NSMutableArray<NSURLRequest *> new];
360+
if (array.count == 0) { return [requests copy]; }
361+
for (id value in array) {
362+
if (value == (id)[NSNull null]) {
363+
RCTLogConvertError(json, @"a valid NSArray<NSURLRequest *>");
364+
return nil;
368365
}
369-
return [requests copy];
366+
NSURLRequest *request = [RCTConvert NSURLRequest:value];
367+
if (request == nil) {
368+
RCTLogConvertError(value, @"a valid NSURLRequest");
369+
return nil;
370+
}
371+
[requests addObject:request];
372+
}
373+
return [requests copy];
370374
}
371375

372376
@end

ios/RNImglyKitSubclass.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ typedef void (^IMGLYCompletionBlock)(void);
6060
@property (strong, atomic, nullable) RCTPromiseResolveBlock resolve;
6161
@property (strong, atomic, nullable) RCTPromiseRejectBlock reject;
6262
@property (strong, atomic, nullable) PESDKMediaEditViewController* mediaEditViewController;
63+
@property (atomic) BOOL exportVideoSegments;
64+
@property (strong, atomic, nullable) NSString* uuid;
6365

6466
- (void)present:(nonnull IMGLYMediaEditViewControllerBlock)createMediaEditViewController withUTI:(nonnull IMGLYUTIBlock)getUTI
6567
configuration:(nullable NSDictionary *)dictionary serialization:(nullable NSDictionary *)state

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-photoeditorsdk",
33
"title": "React Native module for PhotoEditor SDK",
4-
"version": "2.15.0",
4+
"version": "2.16.0",
55
"description": "A React Native module for PhotoEditor SDK. Integrate the photo editor into your own HTML5, iOS or Android app - in minutes!",
66
"main": "index.js",
77
"typings": "index.d.ts",
@@ -38,6 +38,6 @@
3838
"react-native": ">=0.60.0 <1.0.x"
3939
},
4040
"dependencies": {
41-
"react-native-imglysdk": "2.15.0"
41+
"react-native-imglysdk": "2.16.0"
4242
}
4343
}

0 commit comments

Comments
 (0)