react-native-video-trim 3.0.9 → 4.0.0
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/LICENSE +1 -1
- package/README.md +64 -61
- package/VideoTrim.podspec +24 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +77 -51
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +4 -2
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrim.kt +629 -0
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +22 -0
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/enums/ErrorCode.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/IVideoTrimmerView.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/VideoTrimListener.java +6 -4
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/MediaMetadataUtil.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/StorageUtil.java +3 -1
- package/android/src/main/java/com/margelo/nitro/videotrim/utils/VideoTrimmerUtil.java +157 -0
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/widgets/VideoTrimmerView.java +44 -72
- package/ios/AssetLoader.swift +2 -2
- package/ios/ErrorCode.swift +2 -2
- package/ios/ProgressAlertController.swift +2 -2
- package/ios/VideoTrim.swift +38 -739
- package/ios/VideoTrimImpl.swift +860 -0
- package/ios/VideoTrimmer.swift +2 -3
- package/ios/VideoTrimmerThumb.swift +33 -26
- package/ios/VideoTrimmerViewController.swift +47 -28
- package/lib/module/VideoTrim.nitro.js +4 -0
- package/lib/module/VideoTrim.nitro.js.map +1 -0
- package/lib/module/index.js +71 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/{index.d.ts → src/VideoTrim.nitro.d.ts} +63 -89
- package/lib/typescript/src/VideoTrim.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +41 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JEditorConfig.hpp +229 -0
- package/nitrogen/generated/android/c++/JFileValidationResult.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +89 -0
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +131 -0
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +82 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +35 -0
- package/nitrogen/generated/android/videotrim+autolinking.cmake +78 -0
- package/nitrogen/generated/android/videotrim+autolinking.gradle +27 -0
- package/nitrogen/generated/android/videotrimOnLoad.cpp +50 -0
- package/nitrogen/generated/android/videotrimOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/VideoTrim+autolinking.rb +60 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +88 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +331 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +53 -0
- package/nitrogen/generated/ios/VideoTrimAutolinking.mm +33 -0
- package/nitrogen/generated/ios/VideoTrimAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +116 -0
- package/nitrogen/generated/ios/swift/EditorConfig.swift +519 -0
- package/nitrogen/generated/ios/swift/FileValidationResult.swift +57 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +53 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +222 -0
- package/nitrogen/generated/shared/c++/EditorConfig.hpp +245 -0
- package/nitrogen/generated/shared/c++/FileValidationResult.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +76 -0
- package/package.json +75 -71
- package/src/VideoTrim.nitro.ts +244 -0
- package/src/index.tsx +87 -258
- package/android/src/main/AndroidManifestDeprecated.xml +0 -3
- package/android/src/main/java/com/videotrim/VideoTrimModule.java +0 -600
- package/android/src/main/java/com/videotrim/VideoTrimPackage.java +0 -28
- package/android/src/main/java/com/videotrim/utils/VideoTrimmerUtil.java +0 -270
- package/ios/VideoTrim-Bridging-Header.h +0 -2
- package/ios/VideoTrim.mm +0 -17
- package/ios/VideoTrim.xcodeproj/project.pbxproj +0 -283
- package/lib/commonjs/index.js +0 -87
- package/lib/commonjs/index.js.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/react-native-video-trim.podspec +0 -41
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Mai Trung Duc
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
6
|
in the Software without restriction, including without limitation the rights
|
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
- [Installation](#installation)
|
|
2
|
+
* [For iOS (React Native CLI project)](#for-ios-react-native-cli-project)
|
|
3
|
+
* [For Expo project](#for-expo-project)
|
|
4
|
+
* [Usage](#usage)
|
|
5
|
+
- [Methods](#methods)
|
|
6
|
+
* [showEditor(videoPath: string, config?: EditorConfig, onEvent?: (eventName: string, payload: Record<string, string>) => void)](#showeditorvideopath-string-config-editorconfig-onevent-eventname-string-payload-record--void)
|
|
7
|
+
* [isValidFile(videoPath: string)](#isvalidfilevideopath-string)
|
|
8
|
+
* [closeEditor()](#closeeditor)
|
|
9
|
+
* [listFiles()](#listfiles)
|
|
10
|
+
* [cleanFiles()](#cleanfiles)
|
|
11
|
+
* [deleteFile()](#deletefile)
|
|
12
|
+
- [Callbacks (New arch)](#callbacks-new-arch)
|
|
13
|
+
* [showEditor](#showeditor)
|
|
14
|
+
* [closeEditor](#closeeditor-1)
|
|
15
|
+
- [Events (Old arch)](#events-old-arch)
|
|
16
|
+
- [Audio support](#audio-support)
|
|
17
|
+
- [Cancel trimming](#cancel-trimming)
|
|
18
|
+
- [Fail to load media](#fail-to-load-media)
|
|
19
|
+
- [Android: update SDK version](#android-update-sdk-version)
|
|
20
|
+
- [Thanks](#thanks)
|
|
21
|
+
|
|
22
|
+
<!-- TOC end -->
|
|
23
|
+
|
|
1
24
|
# React Native Video Trim
|
|
2
25
|
<div align="center">
|
|
3
26
|
<h2>Video trimmer for your React Native app</h2>
|
|
@@ -12,21 +35,33 @@
|
|
|
12
35
|
- ✅ Save to Photos, Documents and Share to other apps
|
|
13
36
|
- ✅ Check if file is valid video/audio
|
|
14
37
|
- ✅ File operations: list, clean up, delete specific file
|
|
38
|
+
- ✅ Support React Native New + Old Arch
|
|
15
39
|
|
|
16
40
|
<div align="left">
|
|
17
41
|
<img src="images/document_picker.png" width="300" />
|
|
18
42
|
<img src="images/share_sheet.png" width="300" />
|
|
19
43
|
</div>
|
|
20
44
|
|
|
21
|
-
|
|
45
|
+
# Installation
|
|
22
46
|
|
|
23
47
|
```sh
|
|
24
|
-
|
|
48
|
+
# new arch
|
|
49
|
+
npm install react-native-video-trim react-native-nitro-modules
|
|
50
|
+
|
|
51
|
+
# old arch
|
|
52
|
+
npm install react-native-video-trim@^3.0.0
|
|
25
53
|
|
|
26
54
|
# or with yarn
|
|
27
55
|
|
|
28
|
-
|
|
56
|
+
# new arch
|
|
57
|
+
yarn add react-native-video-trim react-native-nitro-modules
|
|
58
|
+
|
|
59
|
+
# old arch
|
|
60
|
+
yarn add react-native-video-trim@^3.0.0
|
|
29
61
|
```
|
|
62
|
+
|
|
63
|
+
> `react-native-nitro-modules` is required in New Arch as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
64
|
+
|
|
30
65
|
## For iOS (React Native CLI project)
|
|
31
66
|
Run the following command to setup for iOS:
|
|
32
67
|
```
|
|
@@ -70,62 +105,8 @@ import {
|
|
|
70
105
|
} from 'react-native';
|
|
71
106
|
import { isValidFile, showEditor } from 'react-native-video-trim';
|
|
72
107
|
import { launchImageLibrary } from 'react-native-image-picker';
|
|
73
|
-
import { useEffect } from 'react';
|
|
74
108
|
|
|
75
109
|
export default function App() {
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
const eventEmitter = new NativeEventEmitter(NativeModules.VideoTrim);
|
|
78
|
-
const subscription = eventEmitter.addListener('VideoTrim', (event) => {
|
|
79
|
-
switch (event.name) {
|
|
80
|
-
case 'onLoad': {
|
|
81
|
-
// on media loaded successfully
|
|
82
|
-
console.log('onLoadListener', event);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
case 'onShow': {
|
|
86
|
-
console.log('onShowListener', event);
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
case 'onHide': {
|
|
90
|
-
console.log('onHide', event);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
case 'onStartTrimming': {
|
|
94
|
-
console.log('onStartTrimming', event);
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
case 'onFinishTrimming': {
|
|
98
|
-
console.log('onFinishTrimming', event);
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
case 'onCancelTrimming': {
|
|
102
|
-
console.log('onCancelTrimming', event);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
case 'onCancel': {
|
|
106
|
-
console.log('onCancel', event);
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case 'onError': {
|
|
110
|
-
console.log('onError', event);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
case 'onLog': {
|
|
114
|
-
console.log('onLog', event);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
case 'onStatistics': {
|
|
118
|
-
console.log('onStatistics', event);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
return () => {
|
|
125
|
-
subscription.remove();
|
|
126
|
-
};
|
|
127
|
-
}, []);
|
|
128
|
-
|
|
129
110
|
return (
|
|
130
111
|
<View style={styles.container}>
|
|
131
112
|
<TouchableOpacity
|
|
@@ -141,7 +122,11 @@ export default function App() {
|
|
|
141
122
|
|
|
142
123
|
showEditor(result.assets![0]?.uri || '', {
|
|
143
124
|
maxDuration: 20,
|
|
144
|
-
}
|
|
125
|
+
},
|
|
126
|
+
(eventName, payload) => {
|
|
127
|
+
console.log('Event:', eventName, 'Payload:', payload);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
145
130
|
}}
|
|
146
131
|
style={{ padding: 10, backgroundColor: 'red' }}
|
|
147
132
|
>
|
|
@@ -174,7 +159,7 @@ const styles = StyleSheet.create({
|
|
|
174
159
|
|
|
175
160
|
# Methods
|
|
176
161
|
|
|
177
|
-
## showEditor(videoPath: string, config?: EditorConfig)
|
|
162
|
+
## showEditor(videoPath: string, config?: EditorConfig, onEvent?: (eventName: string, payload: Record<string, string>) => void)
|
|
178
163
|
Main method to show Video Editor UI.
|
|
179
164
|
|
|
180
165
|
*Params*:
|
|
@@ -226,7 +211,6 @@ Main method to show Video Editor UI.
|
|
|
226
211
|
- `alertOnFailTitle` (`default = "Error"`)
|
|
227
212
|
- `alertOnFailMessage` (`default = "Fail to load media. Possibly invalid file or no network connection"`)
|
|
228
213
|
- `alertOnFailCloseText` (`default = "Close"`)
|
|
229
|
-
- `progressUpdateInterval` (`default = 0.1`): how fast the trimming progress update interval is, default is emit progress every 100ms (0.1 second)
|
|
230
214
|
|
|
231
215
|
If `saveToPhoto = true`, you must ensure that you have request permission to write to photo/gallery
|
|
232
216
|
- For Android: you need to have `<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />` in AndroidManifest.xml
|
|
@@ -274,7 +258,26 @@ Clean all generated output files in app storage. Return number of successfully d
|
|
|
274
258
|
## deleteFile()
|
|
275
259
|
Delete a file in app storage. Return `true` if success
|
|
276
260
|
|
|
277
|
-
#
|
|
261
|
+
# Callbacks (New arch)
|
|
262
|
+
|
|
263
|
+
## showEditor
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
showEditor('file', config, (eventName, payload) => {
|
|
267
|
+
console.log(eventName, payload)
|
|
268
|
+
})
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## closeEditor
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
closeEditor(() => {
|
|
275
|
+
console.log('Editor closed')
|
|
276
|
+
})
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
# Events (Old arch)
|
|
278
281
|
To listen for events you interest, do the following:
|
|
279
282
|
```js
|
|
280
283
|
useEffect(() => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "VideoTrim"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/maitrungduc1410/react-native-video-trim.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
|
+
|
|
18
|
+
s.dependency 'ffmpeg-mobile-min', '~> 6.0'
|
|
19
|
+
|
|
20
|
+
load 'nitrogen/generated/ios/VideoTrim+autolinking.rb'
|
|
21
|
+
add_nitrogen_files(s)
|
|
22
|
+
|
|
23
|
+
install_modules_dependencies(s)
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
project(videotrim)
|
|
2
|
+
cmake_minimum_required(VERSION 3.9.0)
|
|
3
|
+
|
|
4
|
+
set(PACKAGE_NAME videotrim)
|
|
5
|
+
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
7
|
+
|
|
8
|
+
# Define C++ library and add all sources
|
|
9
|
+
add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp)
|
|
10
|
+
|
|
11
|
+
# Add Nitrogen specs :)
|
|
12
|
+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/videotrim+autolinking.cmake)
|
|
13
|
+
|
|
14
|
+
# Set up local includes
|
|
15
|
+
include_directories("src/main/cpp" "../cpp")
|
|
16
|
+
|
|
17
|
+
find_library(LOG_LIB log)
|
|
18
|
+
|
|
19
|
+
# Link all libraries together
|
|
20
|
+
target_link_libraries(
|
|
21
|
+
${PACKAGE_NAME}
|
|
22
|
+
${LOG_LIB}
|
|
23
|
+
android # <-- Android core
|
|
24
|
+
)
|
package/android/build.gradle
CHANGED
|
@@ -1,70 +1,94 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['VideoTrim_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
repositories {
|
|
3
7
|
google()
|
|
4
8
|
mavenCentral()
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
dependencies {
|
|
8
|
-
classpath "com.android.tools.build:gradle:7.2
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
9
15
|
}
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
def
|
|
13
|
-
|
|
18
|
+
def reactNativeArchitectures() {
|
|
19
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
20
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
apply plugin: "com.android.library"
|
|
24
|
+
apply plugin: "kotlin-android"
|
|
25
|
+
apply from: '../nitrogen/generated/android/videotrim+autolinking.gradle'
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
|
|
20
|
-
|
|
21
|
-
if (isNewArchitectureEnabled()) {
|
|
22
|
-
apply plugin: "com.facebook.react"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
def getExtOrDefault(name) {
|
|
26
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["VideoTrim_" + name]
|
|
27
|
-
}
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
28
|
|
|
29
29
|
def getExtOrIntegerDefault(name) {
|
|
30
30
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["VideoTrim_" + name]).toInteger()
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def major = parsed[0].toInteger()
|
|
36
|
-
def minor = parsed[1].toInteger()
|
|
37
|
-
|
|
38
|
-
// Namespace support was added in 7.3.0
|
|
39
|
-
if (major == 7 && minor >= 3) {
|
|
40
|
-
return true
|
|
41
|
-
}
|
|
33
|
+
android {
|
|
34
|
+
namespace "com.margelo.nitro.videotrim"
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
}
|
|
36
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
defaultConfig {
|
|
39
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
40
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
externalNativeBuild {
|
|
43
|
+
cmake {
|
|
44
|
+
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
|
45
|
+
arguments "-DANDROID_STL=c++_shared"
|
|
46
|
+
abiFilters (*reactNativeArchitectures())
|
|
47
|
+
|
|
48
|
+
buildTypes {
|
|
49
|
+
debug {
|
|
50
|
+
cppFlags "-O1 -g"
|
|
51
|
+
}
|
|
52
|
+
release {
|
|
53
|
+
cppFlags "-O2"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
externalNativeBuild {
|
|
61
|
+
cmake {
|
|
62
|
+
path "CMakeLists.txt"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
packagingOptions {
|
|
67
|
+
excludes = [
|
|
68
|
+
"META-INF",
|
|
69
|
+
"META-INF/**",
|
|
70
|
+
"**/libc++_shared.so",
|
|
71
|
+
"**/libfbjni.so",
|
|
72
|
+
"**/libjsi.so",
|
|
73
|
+
"**/libfolly_json.so",
|
|
74
|
+
"**/libfolly_runtime.so",
|
|
75
|
+
"**/libglog.so",
|
|
76
|
+
"**/libhermes.so",
|
|
77
|
+
"**/libhermes-executor-debug.so",
|
|
78
|
+
"**/libhermes_executor.so",
|
|
79
|
+
"**/libreactnative.so",
|
|
80
|
+
"**/libreactnativejni.so",
|
|
81
|
+
"**/libturbomodulejsijni.so",
|
|
82
|
+
"**/libreact_nativemodule_core.so",
|
|
83
|
+
"**/libjscexecutor.so"
|
|
84
|
+
]
|
|
67
85
|
}
|
|
86
|
+
|
|
87
|
+
buildFeatures {
|
|
88
|
+
buildConfig true
|
|
89
|
+
prefab true
|
|
90
|
+
}
|
|
91
|
+
|
|
68
92
|
buildTypes {
|
|
69
93
|
release {
|
|
70
94
|
minifyEnabled false
|
|
@@ -80,6 +104,14 @@ android {
|
|
|
80
104
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
81
105
|
}
|
|
82
106
|
|
|
107
|
+
sourceSets {
|
|
108
|
+
main {
|
|
109
|
+
java.srcDirs += [
|
|
110
|
+
"generated/java",
|
|
111
|
+
"generated/jni"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
83
115
|
}
|
|
84
116
|
|
|
85
117
|
repositories {
|
|
@@ -87,19 +119,13 @@ repositories {
|
|
|
87
119
|
google()
|
|
88
120
|
}
|
|
89
121
|
|
|
122
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
90
123
|
|
|
91
124
|
dependencies {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
implementation "com.facebook.react:react-native:+"
|
|
96
|
-
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
|
97
|
-
}
|
|
125
|
+
implementation "com.facebook.react:react-android"
|
|
126
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
127
|
+
implementation project(":react-native-nitro-modules")
|
|
98
128
|
|
|
99
|
-
|
|
100
|
-
react {
|
|
101
|
-
jsRootDir = file("../src/")
|
|
102
|
-
libraryName = "VideoTrim"
|
|
103
|
-
codegenJavaPackageName = "com.videotrim"
|
|
104
|
-
}
|
|
129
|
+
implementation 'io.github.maitrungduc1410:ffmpeg-kit-min:6.0.0'
|
|
105
130
|
}
|
|
131
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
VideoTrim_kotlinVersion=
|
|
2
|
-
VideoTrim_minSdkVersion=
|
|
3
|
-
VideoTrim_targetSdkVersion=
|
|
4
|
-
VideoTrim_compileSdkVersion=
|
|
5
|
-
|
|
1
|
+
VideoTrim_kotlinVersion=2.0.21
|
|
2
|
+
VideoTrim_minSdkVersion=24
|
|
3
|
+
VideoTrim_targetSdkVersion=34
|
|
4
|
+
VideoTrim_compileSdkVersion=35
|
|
5
|
+
VideoTrim_ndkVersion=27.1.12297006
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
<manifest
|
|
1
|
+
<manifest
|
|
2
|
+
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="com.margelo.nitro.videotrim">
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<uses-permission android:name="android.permission.VIBRATE" />
|
|
4
6
|
|
|
5
7
|
<application>
|
|
6
8
|
<!-- FileProvider setup -->
|