react-native-video-trim 1.0.9 → 1.0.10
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 +12 -0
- package/ios/VideoTrim.swift +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -204,6 +204,18 @@ useEffect(() => {
|
|
|
204
204
|
};
|
|
205
205
|
}, []);
|
|
206
206
|
```
|
|
207
|
+
# FFMPEG Version
|
|
208
|
+
This library uses FFMPEG-Kit Android under the hood, by default FFMPEG-min is used, which gives smallest bundle size: https://github.com/arthenica/ffmpeg-kit#9-packages
|
|
207
209
|
|
|
210
|
+
If you ever need to use other version of FFMPEG-Kit for Android, you can do the following, in your `android/build.gradle` > `buildscript` > `ext`:
|
|
211
|
+
|
|
212
|
+
```gradle
|
|
213
|
+
buildscript {
|
|
214
|
+
ext {
|
|
215
|
+
ffmpegKitPackage = "full" // default "min", if followed by lts then LTS version is use. Eg "full-lts"
|
|
216
|
+
|
|
217
|
+
ffmpegKitPackageVersion = "5.1.LTS" // use exact version, highest precedence, default 6.0-2 if ignored
|
|
218
|
+
}
|
|
219
|
+
```
|
|
208
220
|
# Thanks
|
|
209
221
|
Android part is created by modified + fix bugs from [original project](Android-Video-Trimmer)
|
package/ios/VideoTrim.swift
CHANGED
|
@@ -65,8 +65,13 @@ class VideoTrim: RCTEventEmitter, UIVideoEditorControllerDelegate, UINavigationC
|
|
|
65
65
|
root.present(editController, animated: true, completion: {
|
|
66
66
|
self.emitEventToJS("onShow", eventData: nil)
|
|
67
67
|
self.isShowing = true
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// run "during" presenting so that user sees texts update immediately
|
|
71
|
+
// putting inside "present" will briefly show old texts then changed to new one, user can clearly see this
|
|
72
|
+
// with out DispatchQueue.main.asyncAfter, topItem is still nil
|
|
73
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
|
74
|
+
if let topItem = editController.navigationBar.topItem {
|
|
70
75
|
if let title = config["title"] as? String, !title.isEmpty {
|
|
71
76
|
topItem.title = title
|
|
72
77
|
}
|
|
@@ -82,7 +87,7 @@ class VideoTrim: RCTEventEmitter, UIVideoEditorControllerDelegate, UINavigationC
|
|
|
82
87
|
topItem.rightBarButtonItem = UIBarButtonItem(title: saveBtnText, style: topItem.rightBarButtonItem?.style ?? .plain, target: topItem.rightBarButtonItem?.target, action: topItem.rightBarButtonItem?.action)
|
|
83
88
|
}
|
|
84
89
|
}
|
|
85
|
-
}
|
|
90
|
+
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
} else {
|