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.
package/android/build.gradle
CHANGED
|
@@ -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-
|
|
109
|
+
implementation 'com.arthenica:ffmpeg-kit-' + safePackageName(safeExtGet('ffmpegKitPackage', 'min')) + ':' + safePackageVersion(safeExtGet('ffmpegKitPackage', 'min'))
|
|
94
110
|
}
|
|
95
111
|
|
|
96
112
|
if (isNewArchitectureEnabled()) {
|
|
@@ -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;
|