react-native-video-trim 1.0.8 → 1.0.9

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.
@@ -43,6 +43,22 @@ def supportsNamespace() {
43
43
  return major >= 8
44
44
  }
45
45
 
46
+ static def safePackageName(String packageName) {
47
+ packageName.replace("-lts", "")
48
+ }
49
+
50
+ def safePackageVersion(String packageName) {
51
+ def version = project.properties['ffmpegKit.android.main.version']
52
+ def ltsVersion = project.properties['ffmpegKit.android.lts.version']
53
+
54
+ // try to get ffmpegKitPackageVersion if possible
55
+ safeExtGet("ffmpegKitPackageVersion", packageName.contains("-lts") ? ltsVersion + ".LTS" : version)
56
+ }
57
+
58
+ def safeExtGet(String prop, String fallback) {
59
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
60
+ }
61
+
46
62
  android {
47
63
  if (supportsNamespace()) {
48
64
  namespace "com.videotrim"
@@ -90,7 +106,7 @@ dependencies {
90
106
  //noinspection GradleDynamicVersion
91
107
  implementation "com.facebook.react:react-native:+"
92
108
  implementation 'androidx.recyclerview:recyclerview:1.3.1'
93
- implementation 'com.arthenica:ffmpeg-kit-full:5.1.LTS'
109
+ implementation 'com.arthenica:ffmpeg-kit-' + safePackageName(safeExtGet('ffmpegKitPackage', 'min')) + ':' + safePackageVersion(safeExtGet('ffmpegKitPackage', 'min'))
94
110
  }
95
111
 
96
112
  if (isNewArchitectureEnabled()) {
@@ -3,3 +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.main.version=6.0-2
7
+ ffmpegKit.android.lts.version=6.0-2
@@ -59,7 +59,7 @@ public class VideoTrimmerUtil {
59
59
  }, log -> {
60
60
 
61
61
  }, statistics -> {
62
- int timeInMilliseconds = statistics.getTime();
62
+ int timeInMilliseconds = (int) statistics.getTime();
63
63
  if (timeInMilliseconds > 0) {
64
64
  int completePercentage =
65
65
  (timeInMilliseconds * 100) / videoDuration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",