react-native-video-trim 4.0.0 → 5.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 +124 -83
- package/VideoTrim.podspec +4 -4
- package/android/build.gradle +15 -54
- package/android/gradle.properties +2 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/videotrim/VideoTrimModule.kt +660 -0
- package/android/src/main/java/com/videotrim/VideoTrimPackage.kt +33 -0
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/enums/ErrorCode.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/IVideoTrimmerView.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/VideoTrimListener.java +5 -4
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/MediaMetadataUtil.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/StorageUtil.java +1 -1
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/VideoTrimmerUtil.java +49 -39
- package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/widgets/VideoTrimmerView.java +49 -46
- package/ios/AssetLoader.h +19 -0
- package/ios/AssetLoader.mm +87 -0
- package/ios/ErrorCode.h +9 -0
- package/ios/ProgressAlertController.h +15 -0
- package/ios/ProgressAlertController.mm +78 -0
- package/ios/VideoTrim.h +31 -0
- package/ios/VideoTrim.mm +663 -0
- package/ios/VideoTrimmer.h +67 -0
- package/ios/VideoTrimmer.mm +863 -0
- package/ios/VideoTrimmerThumb.h +23 -0
- package/ios/VideoTrimmerThumb.mm +175 -0
- package/ios/VideoTrimmerViewController.h +52 -0
- package/ios/VideoTrimmerViewController.mm +533 -0
- package/lib/module/NativeVideoTrim.js +5 -0
- package/lib/module/NativeVideoTrim.js.map +1 -0
- package/lib/module/index.js +59 -34
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeVideoTrim.d.ts +107 -0
- package/lib/typescript/src/NativeVideoTrim.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +21 -10
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +15 -18
- package/src/NativeVideoTrim.ts +113 -0
- package/src/index.tsx +68 -39
- package/android/CMakeLists.txt +0 -24
- package/android/src/main/cpp/cpp-adapter.cpp +0 -6
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrim.kt +0 -629
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +0 -22
- package/ios/AssetLoader.swift +0 -99
- package/ios/ErrorCode.swift +0 -17
- package/ios/ProgressAlertController.swift +0 -100
- package/ios/VideoTrim.swift +0 -60
- package/ios/VideoTrimImpl.swift +0 -860
- package/ios/VideoTrimmer.swift +0 -872
- package/ios/VideoTrimmerThumb.swift +0 -175
- package/ios/VideoTrimmerViewController.swift +0 -557
- package/lib/module/VideoTrim.nitro.js +0 -4
- package/lib/module/VideoTrim.nitro.js.map +0 -1
- package/lib/typescript/src/VideoTrim.nitro.d.ts +0 -240
- package/lib/typescript/src/VideoTrim.nitro.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JEditorConfig.hpp +0 -229
- package/nitrogen/generated/android/c++/JFileValidationResult.hpp +0 -61
- package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -74
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +0 -89
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +0 -131
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +0 -67
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +0 -70
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +0 -28
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +0 -82
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +0 -35
- package/nitrogen/generated/android/videotrim+autolinking.cmake +0 -78
- package/nitrogen/generated/android/videotrim+autolinking.gradle +0 -27
- package/nitrogen/generated/android/videotrimOnLoad.cpp +0 -50
- package/nitrogen/generated/android/videotrimOnLoad.hpp +0 -25
- package/nitrogen/generated/ios/VideoTrim+autolinking.rb +0 -60
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +0 -88
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +0 -331
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +0 -53
- package/nitrogen/generated/ios/VideoTrimAutolinking.mm +0 -33
- package/nitrogen/generated/ios/VideoTrimAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +0 -116
- package/nitrogen/generated/ios/swift/EditorConfig.swift +0 -519
- package/nitrogen/generated/ios/swift/FileValidationResult.swift +0 -57
- package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_double.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +0 -54
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +0 -53
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +0 -222
- package/nitrogen/generated/shared/c++/EditorConfig.hpp +0 -245
- package/nitrogen/generated/shared/c++/FileValidationResult.hpp +0 -77
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +0 -26
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +0 -76
- package/src/VideoTrim.nitro.ts +0 -244
package/src/VideoTrim.nitro.ts
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
|
|
3
|
-
export interface EditorConfig {
|
|
4
|
-
/**
|
|
5
|
-
* Enable haptic feedback
|
|
6
|
-
* @default true
|
|
7
|
-
*/
|
|
8
|
-
enableHapticFeedback: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Save the output file to Photos Library. Only video is supported. Note that you have to make sure you have permission to save to Photos Library.
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
saveToPhoto: boolean;
|
|
14
|
-
maxDuration: number;
|
|
15
|
-
/**
|
|
16
|
-
* Minimum duration for trimmer
|
|
17
|
-
* @default 1000
|
|
18
|
-
*/
|
|
19
|
-
minDuration: number;
|
|
20
|
-
/**
|
|
21
|
-
* Cancel button text
|
|
22
|
-
* @default "Cancel"
|
|
23
|
-
*/
|
|
24
|
-
cancelButtonText: string;
|
|
25
|
-
/**
|
|
26
|
-
* Save button text
|
|
27
|
-
* @default "Save"
|
|
28
|
-
*/
|
|
29
|
-
saveButtonText: string;
|
|
30
|
-
/**
|
|
31
|
-
* Enable cancel dialog
|
|
32
|
-
* @default true
|
|
33
|
-
*/
|
|
34
|
-
enableCancelDialog: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Cancel dialog title
|
|
37
|
-
* @default "Warning!"
|
|
38
|
-
*/
|
|
39
|
-
cancelDialogTitle: string;
|
|
40
|
-
/**
|
|
41
|
-
* Cancel dialog message
|
|
42
|
-
* @default "Are you sure want to cancel?"
|
|
43
|
-
*/
|
|
44
|
-
cancelDialogMessage: string;
|
|
45
|
-
/**
|
|
46
|
-
* Cancel dialog cancel text
|
|
47
|
-
* @default "Close"
|
|
48
|
-
*/
|
|
49
|
-
cancelDialogCancelText: string;
|
|
50
|
-
/**
|
|
51
|
-
* Cancel dialog confirm text
|
|
52
|
-
* @default "Proceed"
|
|
53
|
-
*/
|
|
54
|
-
cancelDialogConfirmText: string;
|
|
55
|
-
/**
|
|
56
|
-
* Enable save dialog
|
|
57
|
-
* @default true
|
|
58
|
-
*/
|
|
59
|
-
enableSaveDialog: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Save dialog title
|
|
62
|
-
* @default "Confirmation!"
|
|
63
|
-
*/
|
|
64
|
-
saveDialogTitle: string;
|
|
65
|
-
/**
|
|
66
|
-
* Save dialog message
|
|
67
|
-
* @default "Are you sure want to save?"
|
|
68
|
-
*/
|
|
69
|
-
saveDialogMessage: string;
|
|
70
|
-
/**
|
|
71
|
-
* Save dialog cancel text
|
|
72
|
-
* @default "Close"
|
|
73
|
-
*/
|
|
74
|
-
saveDialogCancelText: string;
|
|
75
|
-
/**
|
|
76
|
-
* Save dialog confirm text
|
|
77
|
-
* @default "Proceed"
|
|
78
|
-
*/
|
|
79
|
-
saveDialogConfirmText: string;
|
|
80
|
-
/**
|
|
81
|
-
* Trimming text
|
|
82
|
-
* @default "Trimming video..."
|
|
83
|
-
*/
|
|
84
|
-
trimmingText: string;
|
|
85
|
-
/**
|
|
86
|
-
* By default, on iOS the editor will be presented as a modal. If you want to present it as a full screen modal, set this to `true`.
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
fullScreenModalIOS: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Type of the file to edit. If video file, recommend to use `video`. If audio file, recommend to use `audio`.
|
|
92
|
-
* @default "video"
|
|
93
|
-
*/
|
|
94
|
-
type: string;
|
|
95
|
-
/**
|
|
96
|
-
* Output file extension. If video file, recommend to use `mp4` or `mov`. If audio file, recommend to use `wav` or `m4a`.
|
|
97
|
-
* @default "mp4"
|
|
98
|
-
* @example "mp4", "mov", "wav", "m4a", "3gp", "avi", "mkv", "flv", "wmv", "webm"
|
|
99
|
-
*/
|
|
100
|
-
outputExt: string;
|
|
101
|
-
/**
|
|
102
|
-
* Whether to open Documents app after finish editing
|
|
103
|
-
* @default false
|
|
104
|
-
*/
|
|
105
|
-
openDocumentsOnFinish: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Whether to open Share Sheet after finish editing
|
|
108
|
-
* @default false
|
|
109
|
-
*/
|
|
110
|
-
openShareSheetOnFinish: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Remove the file after saved to Photos Library
|
|
113
|
-
* @default false
|
|
114
|
-
*/
|
|
115
|
-
removeAfterSavedToPhoto: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* Remove the file after failed to save to Photos Library
|
|
118
|
-
* @default false
|
|
119
|
-
*/
|
|
120
|
-
removeAfterFailedToSavePhoto: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Remove the file after saved to Documents app
|
|
123
|
-
* @default false
|
|
124
|
-
*/
|
|
125
|
-
removeAfterSavedToDocuments: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Remove the file after failed to save to Documents app
|
|
128
|
-
* @default false
|
|
129
|
-
*/
|
|
130
|
-
removeAfterFailedToSaveDocuments: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Remove the file after shared to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
133
|
-
* @default false
|
|
134
|
-
*/
|
|
135
|
-
removeAfterShared: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Remove the file after failed to share to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
138
|
-
* @default false
|
|
139
|
-
*/
|
|
140
|
-
removeAfterFailedToShare: boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Whether to enable autoplay on load
|
|
143
|
-
*/
|
|
144
|
-
autoplay: boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Jump to position on load in milliseconds
|
|
147
|
-
* @default `undefined` (beginning of the video)
|
|
148
|
-
*/
|
|
149
|
-
jumpToPositionOnLoad: number;
|
|
150
|
-
/**
|
|
151
|
-
* Whether to close the editor when finish editing
|
|
152
|
-
* @default true
|
|
153
|
-
*/
|
|
154
|
-
closeWhenFinish: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Enable cancel trimming
|
|
157
|
-
* @default true
|
|
158
|
-
*/
|
|
159
|
-
enableCancelTrimming: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Cancel trimming button text
|
|
162
|
-
* @default "Cancel"
|
|
163
|
-
*/
|
|
164
|
-
cancelTrimmingButtonText: string;
|
|
165
|
-
/**
|
|
166
|
-
* Enable cancel trimming dialog
|
|
167
|
-
* @default true
|
|
168
|
-
*/
|
|
169
|
-
enableCancelTrimmingDialog: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Cancel trimming dialog title
|
|
172
|
-
* @default "Warning!"
|
|
173
|
-
*/
|
|
174
|
-
cancelTrimmingDialogTitle: string;
|
|
175
|
-
/**
|
|
176
|
-
* Cancel trimming dialog message
|
|
177
|
-
* @default "Are you sure want to cancel trimming?"
|
|
178
|
-
*/
|
|
179
|
-
cancelTrimmingDialogMessage: string;
|
|
180
|
-
/**
|
|
181
|
-
* Cancel trimming dialog cancel text
|
|
182
|
-
* @default "Close"
|
|
183
|
-
*/
|
|
184
|
-
cancelTrimmingDialogCancelText: string;
|
|
185
|
-
/**
|
|
186
|
-
* Cancel trimming dialog confirm text
|
|
187
|
-
* @default "Proceed"
|
|
188
|
-
*/
|
|
189
|
-
cancelTrimmingDialogConfirmText: string;
|
|
190
|
-
/**
|
|
191
|
-
* Header text
|
|
192
|
-
*/
|
|
193
|
-
headerText: string;
|
|
194
|
-
/**
|
|
195
|
-
* Header text size
|
|
196
|
-
* @default 16
|
|
197
|
-
*/
|
|
198
|
-
headerTextSize: number;
|
|
199
|
-
/**
|
|
200
|
-
* Header text color
|
|
201
|
-
* @default white
|
|
202
|
-
*/
|
|
203
|
-
headerTextColor: number;
|
|
204
|
-
/**
|
|
205
|
-
* Alert on fail to load media
|
|
206
|
-
* @default true
|
|
207
|
-
*/
|
|
208
|
-
alertOnFailToLoad: boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Alert on fail to load media title
|
|
211
|
-
* @default "Error"
|
|
212
|
-
*/
|
|
213
|
-
alertOnFailTitle: string;
|
|
214
|
-
/**
|
|
215
|
-
* Alert on fail to load media message
|
|
216
|
-
* @default "Fail to load media. Possibly invalid file or no network connection"
|
|
217
|
-
*/
|
|
218
|
-
alertOnFailMessage: string;
|
|
219
|
-
/**
|
|
220
|
-
* Alert on fail to load media close text
|
|
221
|
-
* @default "Close"
|
|
222
|
-
*/
|
|
223
|
-
alertOnFailCloseText: string;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export interface FileValidationResult {
|
|
227
|
-
isValid: boolean;
|
|
228
|
-
fileType: string;
|
|
229
|
-
duration: number;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface VideoTrim
|
|
233
|
-
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
234
|
-
showEditor(
|
|
235
|
-
filePath: string,
|
|
236
|
-
config: EditorConfig,
|
|
237
|
-
onEvent: (eventName: string, payload: Record<string, string>) => void // currently nitro modules will fail if there are 2 optional callbacks, to make if work, we need to pass the onEvent as the last parameter
|
|
238
|
-
): void;
|
|
239
|
-
listFiles(): Promise<string[]>;
|
|
240
|
-
cleanFiles(): Promise<number>;
|
|
241
|
-
deleteFile(filePath: string): Promise<boolean>;
|
|
242
|
-
closeEditor(onComplete: () => void): void;
|
|
243
|
-
isValidFile(url: string): Promise<FileValidationResult>;
|
|
244
|
-
}
|