react-native-video-trim 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -147,9 +147,9 @@ Main method to show Video Editor UI.
147
147
 
148
148
  - `saveToPhoto` (optional, `default = true`): whether to save video to photo/gallery after editing
149
149
  - `maxDuration` (optional): maximum duration for the trimmed video
150
- - `leftButtonText` (optional): text for left button in Editor dialog
151
- - `rightButtonText` (optional): text for right button in Editor dialog
152
- - `title` (optional, iOS only): title Editor dialog
150
+ - `cancelButtonText` (optional): text of left button in Editor dialog
151
+ - `saveButtonText` (optional): text of right button in Editor dialog
152
+ - `title` (optional, iOS only): title of Editor dialog
153
153
 
154
154
  If `saveToPhoto = true`, you must ensure that you have request permission to write to photo/gallery
155
155
  - For Android: you need to have `<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />` in AndroidManifest.xml
@@ -493,14 +493,14 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
493
493
  this.mMaxDuration = config.getInt("maxDuration");
494
494
  }
495
495
 
496
- if (config.hasKey("leftButtonText")) {
496
+ if (config.hasKey("cancelButtonText")) {
497
497
  TextView tv = findViewById(R.id.cancelBtn);
498
- tv.setText(config.getString("leftButtonText"));
498
+ tv.setText(config.getString("cancelButtonText"));
499
499
  }
500
500
 
501
- if (config.hasKey("rightButtonText")) {
501
+ if (config.hasKey("saveButtonText")) {
502
502
  TextView tv = findViewById(R.id.saveBtn);
503
- tv.setText(config.getString("rightButtonText"));
503
+ tv.setText(config.getString("saveButtonText"));
504
504
  }
505
505
  }
506
506
  }
@@ -74,12 +74,12 @@ class VideoTrim: RCTEventEmitter, UIVideoEditorControllerDelegate, UINavigationC
74
74
  // when it comes to bar button customization
75
75
  // we can't customize text of original buttons here, we can only set attrs like enabled/hidden
76
76
  // to customize text we need to create new button
77
- if let leftBtnText = config["leftButtonText"] as? String, !leftBtnText.isEmpty {
78
- topItem.leftBarButtonItem = UIBarButtonItem(title: leftBtnText, style: topItem.leftBarButtonItem?.style ?? .plain, target: topItem.leftBarButtonItem?.target, action: topItem.leftBarButtonItem?.action)
77
+ if let cancelBtnText = config["cancelButtonText"] as? String, !cancelBtnText.isEmpty {
78
+ topItem.leftBarButtonItem = UIBarButtonItem(title: cancelBtnText, style: topItem.leftBarButtonItem?.style ?? .plain, target: topItem.leftBarButtonItem?.target, action: topItem.leftBarButtonItem?.action)
79
79
  }
80
80
 
81
- if let rightBtnText = config["rightButtonText"] as? String, !rightBtnText.isEmpty {
82
- topItem.rightBarButtonItem = UIBarButtonItem(title: rightBtnText, style: topItem.rightBarButtonItem?.style ?? .plain, target: topItem.rightBarButtonItem?.target, action: topItem.rightBarButtonItem?.action)
81
+ if let saveBtnText = config["saveButtonText"] as? String, !saveBtnText.isEmpty {
82
+ topItem.rightBarButtonItem = UIBarButtonItem(title: saveBtnText, style: topItem.rightBarButtonItem?.style ?? .plain, target: topItem.rightBarButtonItem?.target, action: topItem.rightBarButtonItem?.action)
83
83
  }
84
84
  }
85
85
  })
@@ -2,8 +2,8 @@ export interface EditorConfig {
2
2
  saveToPhoto?: boolean;
3
3
  maxDuration?: number;
4
4
  title?: string;
5
- leftButtonText?: string;
6
- rightButtonText?: string;
5
+ cancelButtonText?: string;
6
+ saveButtonText?: string;
7
7
  }
8
8
  export declare function showEditor(videoPath: string, config?: EditorConfig): Promise<void>;
9
9
  export declare function isValidVideo(videoPath: string): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,YAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoCf;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEhE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,YAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoCf;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.tsx CHANGED
@@ -21,8 +21,8 @@ export interface EditorConfig {
21
21
  saveToPhoto?: boolean;
22
22
  maxDuration?: number;
23
23
  title?: string;
24
- leftButtonText?: string;
25
- rightButtonText?: string;
24
+ cancelButtonText?: string;
25
+ saveButtonText?: string;
26
26
  }
27
27
 
28
28
  export async function showEditor(