react-native-video-trim 1.0.13 → 1.0.15
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
|
@@ -228,16 +228,33 @@ useEffect(() => {
|
|
|
228
228
|
# FFMPEG Version
|
|
229
229
|
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
|
|
230
230
|
|
|
231
|
+
## Android
|
|
231
232
|
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`:
|
|
232
233
|
|
|
233
234
|
```gradle
|
|
234
235
|
buildscript {
|
|
235
236
|
ext {
|
|
236
|
-
ffmpegKitPackage = "full" // default "min"
|
|
237
|
+
ffmpegKitPackage = "full" // default "min"
|
|
237
238
|
|
|
238
|
-
ffmpegKitPackageVersion = "5.1.LTS" //
|
|
239
|
+
ffmpegKitPackageVersion = "5.1.LTS" // default 6.0-2
|
|
239
240
|
}
|
|
240
241
|
```
|
|
242
|
+
|
|
243
|
+
## iOS
|
|
244
|
+
Same as Android, there're 2 environment variables respectively you can use to specify FFMPEG Kit version you want to use: `FFMPEG_KIT_PACKAGE` and `FFMPEG_KIT_PACKAGE_VERSION`.
|
|
245
|
+
|
|
246
|
+
You need to pass the variables when running pod install. Eg:
|
|
247
|
+
```shell
|
|
248
|
+
# override package name, default: min
|
|
249
|
+
FFMPEGKIT_PACKAGE=full npx pod-install ios
|
|
250
|
+
|
|
251
|
+
# override package version, default: '~> 6.0
|
|
252
|
+
FFMPEGKIT_PACKAGE_VERSION=5.1 npx pod-install ios
|
|
253
|
+
|
|
254
|
+
# or both
|
|
255
|
+
FFMPEGKIT_PACKAGE=full FFMPEGKIT_PACKAGE_VERSION=5.1 npx pod-install ios
|
|
256
|
+
```
|
|
257
|
+
|
|
241
258
|
# Thanks
|
|
242
259
|
- Android part is created by modified + fix bugs from: https://github.com/iknow4/Android-Video-Trimmer
|
|
243
260
|
- iOS UI is created from: https://github.com/AndreasVerhoeven/VideoTrimmerControl
|
package/android/build.gradle
CHANGED
|
@@ -43,16 +43,14 @@ def supportsNamespace() {
|
|
|
43
43
|
return major >= 8
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
def safePackageName() {
|
|
47
|
+
def name = project.properties['ffmpegKit.android.package.name']
|
|
48
|
+
name + '-' + safeExtGet('ffmpegKitPackage', 'min')
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
def safePackageVersion(
|
|
51
|
-
def
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// try to get ffmpegKitPackageVersion if possible
|
|
55
|
-
safeExtGet("ffmpegKitPackageVersion", packageName.contains("-lts") ? ltsVersion + ".LTS" : version)
|
|
51
|
+
def safePackageVersion() {
|
|
52
|
+
def name = project.properties['ffmpegKit.android.package.version']
|
|
53
|
+
safeExtGet('ffmpegKitPackageVersion', name)
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
def safeExtGet(String prop, String fallback) {
|
|
@@ -106,7 +104,7 @@ dependencies {
|
|
|
106
104
|
//noinspection GradleDynamicVersion
|
|
107
105
|
implementation "com.facebook.react:react-native:+"
|
|
108
106
|
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
|
109
|
-
implementation
|
|
107
|
+
implementation safePackageName() + ':' + safePackageVersion()
|
|
110
108
|
}
|
|
111
109
|
|
|
112
110
|
if (isNewArchitectureEnabled()) {
|
|
@@ -3,5 +3,5 @@ VideoTrim_minSdkVersion=21
|
|
|
3
3
|
VideoTrim_targetSdkVersion=31
|
|
4
4
|
VideoTrim_compileSdkVersion=31
|
|
5
5
|
VideoTrim_ndkversion=21.4.7075529
|
|
6
|
-
ffmpegKit.android.
|
|
7
|
-
ffmpegKit.android.
|
|
6
|
+
ffmpegKit.android.package.name=com.arthenica:ffmpeg-kit
|
|
7
|
+
ffmpegKit.android.package.version=6.0-2
|
|
@@ -251,10 +251,10 @@ class VideoTrimmerViewController: UIViewController {
|
|
|
251
251
|
let finalTime = self.trimmer.trimmingState == .none ? CMTimeAdd(time, self.trimmer.selectedRange.start) : time
|
|
252
252
|
self.trimmer.progress = finalTime
|
|
253
253
|
|
|
254
|
-
if player.timeControlStatus == .playing {
|
|
255
|
-
playBtn.setImage(pauseIcon, for: .normal)
|
|
254
|
+
if self.player.timeControlStatus == .playing {
|
|
255
|
+
self.playBtn.setImage(self.pauseIcon, for: .normal)
|
|
256
256
|
} else {
|
|
257
|
-
playBtn.setImage(playIcon, for: .normal)
|
|
257
|
+
self.playBtn.setImage(self.playIcon, for: .normal)
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { :git => "https://github.com/maitrungduc1410/react-native-video-trim.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
-
s.dependency
|
|
18
|
+
s.dependency "ffmpeg-kit-ios-#{ENV['FFMPEGKIT_PACKAGE'] || 'min'}", ENV['FFMPEGKIT_PACKAGE_VERSION'] || '~> 6.0'
|
|
19
19
|
|
|
20
20
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
21
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|