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
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
package com.videotrim.utils;
|
|
2
|
-
|
|
3
|
-
import android.graphics.Bitmap;
|
|
4
|
-
import android.media.MediaCodec;
|
|
5
|
-
import android.media.MediaMetadataRetriever;
|
|
6
|
-
import com.facebook.react.bridge.Arguments;
|
|
7
|
-
import com.facebook.react.bridge.WritableMap;
|
|
8
|
-
import com.videotrim.enums.ErrorCode;
|
|
9
|
-
import com.videotrim.interfaces.VideoTrimListener;
|
|
10
|
-
import iknow.android.utils.DeviceUtil;
|
|
11
|
-
import iknow.android.utils.UnitConverter;
|
|
12
|
-
import iknow.android.utils.callback.SingleCallback;
|
|
13
|
-
import iknow.android.utils.thread.BackgroundExecutor;
|
|
14
|
-
import android.media.MediaExtractor;
|
|
15
|
-
import android.media.MediaFormat;
|
|
16
|
-
import android.media.MediaMuxer;
|
|
17
|
-
import java.io.IOException;
|
|
18
|
-
import java.nio.ByteBuffer;
|
|
19
|
-
|
|
20
|
-
public class VideoTrimmerUtil {
|
|
21
|
-
|
|
22
|
-
private static final String TAG = VideoTrimmerUtil.class.getSimpleName();
|
|
23
|
-
public static final String FILE_PREFIX = "trimmedVideo";
|
|
24
|
-
public static final long MIN_SHOOT_DURATION = 1000L;// min 3 seconds for trimming
|
|
25
|
-
public static final int VIDEO_MAX_TIME = 10;// max 10 seconds for trimming
|
|
26
|
-
public static final long MAX_SHOOT_DURATION = VIDEO_MAX_TIME * 1000L;
|
|
27
|
-
// public static long maxShootDuration = 10 * 1000L;
|
|
28
|
-
public static int MAX_COUNT_RANGE = 10; // how many images in the highlight range of seek bar
|
|
29
|
-
public static int SCREEN_WIDTH_FULL = DeviceUtil.getDeviceWidth();
|
|
30
|
-
public static final int RECYCLER_VIEW_PADDING = UnitConverter.dpToPx(35);
|
|
31
|
-
public static String DEFAULT_AUDIO_EXTENSION = ".wav";
|
|
32
|
-
public static int VIDEO_FRAMES_WIDTH = SCREEN_WIDTH_FULL - RECYCLER_VIEW_PADDING * 2;
|
|
33
|
-
// public static final int THUMB_WIDTH = (SCREEN_WIDTH_FULL - RECYCLER_VIEW_PADDING * 2) / VIDEO_MAX_TIME;
|
|
34
|
-
public static int mThumbWidth = 0; // make it automatic
|
|
35
|
-
public static final int THUMB_HEIGHT = UnitConverter.dpToPx(50); // x2 for better resolution
|
|
36
|
-
public static final int THUMB_WIDTH = UnitConverter.dpToPx(25); // x2 for better resolution
|
|
37
|
-
private static final int THUMB_RESOLUTION_RES = 2; // double thumb resolution for better quality
|
|
38
|
-
|
|
39
|
-
private static final int BUFFER_SIZE = 1024 * 1024; // 1MB buffer
|
|
40
|
-
|
|
41
|
-
// Custom session class to manage trimming and cancellation
|
|
42
|
-
public static class TrimSession {
|
|
43
|
-
private final Thread trimThread;
|
|
44
|
-
private volatile boolean isCancelled = false;
|
|
45
|
-
|
|
46
|
-
private TrimSession(Thread thread) {
|
|
47
|
-
this.trimThread = thread;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public void cancel() {
|
|
51
|
-
isCancelled = true;
|
|
52
|
-
if (trimThread != null) {
|
|
53
|
-
trimThread.interrupt();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public boolean isActive() {
|
|
58
|
-
return !isCancelled;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public static TrimSession trim(String inputFile, String outputFile, int videoDuration, long startMs, long endMs, final VideoTrimListener callback, float progressUpdateInterval) {
|
|
63
|
-
// Start trimming in a background thread
|
|
64
|
-
Thread trimThread = new Thread(() -> {
|
|
65
|
-
MediaExtractor extractor = null;
|
|
66
|
-
MediaMuxer muxer = null;
|
|
67
|
-
TrimSession session = new TrimSession(Thread.currentThread());
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
// Get rotation metadata from input file
|
|
71
|
-
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
|
72
|
-
retriever.setDataSource(inputFile);
|
|
73
|
-
String rotationStr = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
|
|
74
|
-
int rotation = rotationStr != null ? Integer.parseInt(rotationStr) : 0;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
extractor = new MediaExtractor();
|
|
78
|
-
extractor.setDataSource(inputFile);
|
|
79
|
-
|
|
80
|
-
int trackCount = extractor.getTrackCount();
|
|
81
|
-
muxer = new MediaMuxer(outputFile, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
|
|
82
|
-
int[] trackIndices = new int[trackCount];
|
|
83
|
-
long[] trackStartTimes = new long[trackCount];
|
|
84
|
-
boolean[] tracksAdded = new boolean[trackCount];
|
|
85
|
-
int videoTrackIndex = -1;
|
|
86
|
-
|
|
87
|
-
// Calculate trimmed duration
|
|
88
|
-
long startUs = startMs * 1000; // e.g., 5s = 5000000us
|
|
89
|
-
long endUs = endMs * 1000; // e.g., 9s = 9000000us
|
|
90
|
-
long trimmedDurationUs = endUs - startUs; // e.g., 4s = 4000000us
|
|
91
|
-
|
|
92
|
-
// Determine max buffer size from video format and resolution
|
|
93
|
-
int maxBufferSize = BUFFER_SIZE; // Default 1MB
|
|
94
|
-
String widthStr = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
|
|
95
|
-
String heightStr = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
|
|
96
|
-
int width = widthStr != null ? Integer.parseInt(widthStr) : 0; // Default to unknown
|
|
97
|
-
int height = heightStr != null ? Integer.parseInt(heightStr) : 0;
|
|
98
|
-
|
|
99
|
-
// IMPORTANT: after this line, the retriever is no longer needed
|
|
100
|
-
retriever.release();
|
|
101
|
-
|
|
102
|
-
// Adjust buffer size based on resolution
|
|
103
|
-
if (width > 3840 || height > 2160) { // 8K+
|
|
104
|
-
maxBufferSize = 16 * 1024 * 1024; // 16MB for 8K
|
|
105
|
-
} else if (width > 1920 || height > 1080) { // 4K
|
|
106
|
-
maxBufferSize = 8 * 1024 * 1024; // 8MB for 4K
|
|
107
|
-
} else if (width > 1280 || height > 720) { // 1080p
|
|
108
|
-
maxBufferSize = 4 * 1024 * 1024; // 4MB for 1080p
|
|
109
|
-
} // 720p or lower (or unknown resolution) sticks with BUFFER_SIZE (1MB)
|
|
110
|
-
|
|
111
|
-
// Add tracks with corrected duration
|
|
112
|
-
for (int i = 0; i < trackCount; i++) {
|
|
113
|
-
MediaFormat format = extractor.getTrackFormat(i);
|
|
114
|
-
|
|
115
|
-
// Override with KEY_MAX_INPUT_SIZE if available
|
|
116
|
-
if (format.containsKey(MediaFormat.KEY_MAX_INPUT_SIZE)) {
|
|
117
|
-
int maxInputSize = format.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
|
|
118
|
-
maxBufferSize = Math.max(maxBufferSize, maxInputSize);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
String mime = format.getString(MediaFormat.KEY_MIME);
|
|
122
|
-
if (mime != null && mime.startsWith("video/")) {
|
|
123
|
-
videoTrackIndex = i;
|
|
124
|
-
}
|
|
125
|
-
// Set the duration for each track to the trimmed duration
|
|
126
|
-
format.setLong(MediaFormat.KEY_DURATION, trimmedDurationUs);
|
|
127
|
-
trackIndices[i] = muxer.addTrack(format);
|
|
128
|
-
tracksAdded[i] = false;
|
|
129
|
-
extractor.selectTrack(i);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Set rotation metadata on muxer
|
|
133
|
-
muxer.setOrientationHint(rotation);
|
|
134
|
-
|
|
135
|
-
// Seek to start time
|
|
136
|
-
extractor.seekTo(startUs, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
|
|
137
|
-
|
|
138
|
-
ByteBuffer buffer = ByteBuffer.allocate(maxBufferSize);
|
|
139
|
-
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
|
|
140
|
-
long lastProgressTime = System.currentTimeMillis();
|
|
141
|
-
boolean videoSampleWritten = false;
|
|
142
|
-
|
|
143
|
-
muxer.start();
|
|
144
|
-
while (session.isActive()) {
|
|
145
|
-
bufferInfo.size = extractor.readSampleData(buffer, 0);
|
|
146
|
-
if (bufferInfo.size < 0) break; // EOS
|
|
147
|
-
|
|
148
|
-
long sampleTime = extractor.getSampleTime();
|
|
149
|
-
if (sampleTime > endUs) break;
|
|
150
|
-
|
|
151
|
-
bufferInfo.presentationTimeUs = sampleTime;
|
|
152
|
-
int extractorFlags = extractor.getSampleFlags();
|
|
153
|
-
bufferInfo.flags = (extractorFlags & MediaExtractor.SAMPLE_FLAG_SYNC) != 0 ? MediaCodec.BUFFER_FLAG_KEY_FRAME : 0;
|
|
154
|
-
int trackIndex = extractor.getSampleTrackIndex();
|
|
155
|
-
|
|
156
|
-
if (!tracksAdded[trackIndex]) {
|
|
157
|
-
trackStartTimes[trackIndex] = sampleTime;
|
|
158
|
-
tracksAdded[trackIndex] = true;
|
|
159
|
-
}
|
|
160
|
-
bufferInfo.presentationTimeUs -= trackStartTimes[trackIndex]; // Adjust time to start at 0
|
|
161
|
-
|
|
162
|
-
// Ensure presentation time doesn't exceed trimmed duration
|
|
163
|
-
if (bufferInfo.presentationTimeUs >= trimmedDurationUs) {
|
|
164
|
-
extractor.advance();
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (trackIndex == videoTrackIndex) {
|
|
169
|
-
videoSampleWritten = true;
|
|
170
|
-
}
|
|
171
|
-
muxer.writeSampleData(trackIndices[trackIndex], buffer, bufferInfo);
|
|
172
|
-
extractor.advance();
|
|
173
|
-
|
|
174
|
-
long currentTime = System.currentTimeMillis();
|
|
175
|
-
if (currentTime - lastProgressTime >= progressUpdateInterval * 1000) {
|
|
176
|
-
double progress = (double)(sampleTime - startUs) / (endUs - startUs);
|
|
177
|
-
if (progress > 0 && progress <= 1) {
|
|
178
|
-
WritableMap statsMap = Arguments.createMap();
|
|
179
|
-
statsMap.putDouble("time", progress * videoDuration);
|
|
180
|
-
statsMap.putDouble("progress", progress); // Percentage
|
|
181
|
-
|
|
182
|
-
callback.onStatistics(statsMap);
|
|
183
|
-
callback.onTrimmingProgress((int)(progress * 100));
|
|
184
|
-
}
|
|
185
|
-
lastProgressTime = currentTime;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// For static videos: ensure one video frame if none written
|
|
190
|
-
if (!videoSampleWritten && videoTrackIndex != -1) {
|
|
191
|
-
for (int i = 0; i < trackCount; i++) {
|
|
192
|
-
if (i != videoTrackIndex) {
|
|
193
|
-
extractor.unselectTrack(i);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
extractor.selectTrack(videoTrackIndex);
|
|
197
|
-
extractor.seekTo(0, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
|
|
198
|
-
bufferInfo.size = extractor.readSampleData(buffer, 0);
|
|
199
|
-
if (bufferInfo.size >= 0) {
|
|
200
|
-
bufferInfo.presentationTimeUs = 0;
|
|
201
|
-
// Map MediaExtractor flags to MediaCodec flags
|
|
202
|
-
int extractorFlags = extractor.getSampleFlags();
|
|
203
|
-
bufferInfo.flags = (extractorFlags & MediaExtractor.SAMPLE_FLAG_SYNC) != 0 ? MediaCodec.BUFFER_FLAG_KEY_FRAME : 0;
|
|
204
|
-
muxer.writeSampleData(trackIndices[videoTrackIndex], buffer, bufferInfo);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (session.isActive()) {
|
|
209
|
-
muxer.stop();
|
|
210
|
-
callback.onFinishTrim(outputFile, startMs, endMs, videoDuration);
|
|
211
|
-
} else {
|
|
212
|
-
callback.onCancelTrim();
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
} catch (IOException e) {
|
|
216
|
-
e.printStackTrace();
|
|
217
|
-
callback.onError("Trimming failed: " + e.getMessage(), ErrorCode.TRIMMING_FAILED);
|
|
218
|
-
} finally {
|
|
219
|
-
try {
|
|
220
|
-
if (muxer != null && session.isActive()) {
|
|
221
|
-
muxer.release();
|
|
222
|
-
}
|
|
223
|
-
if (extractor != null) extractor.release();
|
|
224
|
-
} catch (Exception e) {
|
|
225
|
-
e.printStackTrace();
|
|
226
|
-
System.err.println("Error releasing resources: " + e.getMessage());
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
TrimSession session = new TrimSession(trimThread);
|
|
232
|
-
trimThread.start();
|
|
233
|
-
return session;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
public static void shootVideoThumbInBackground(final MediaMetadataRetriever mediaMetadataRetriever, final int totalThumbsCount, final long startPosition,
|
|
237
|
-
final long endPosition, final SingleCallback<Bitmap, Integer> callback) {
|
|
238
|
-
BackgroundExecutor.execute(new BackgroundExecutor.Task("", 0L, "") {
|
|
239
|
-
@Override public void execute() {
|
|
240
|
-
try {
|
|
241
|
-
// Retrieve media data use microsecond
|
|
242
|
-
long interval = (endPosition - startPosition) / (totalThumbsCount - 1);
|
|
243
|
-
for (long i = 0; i < totalThumbsCount; ++i) {
|
|
244
|
-
long frameTime = startPosition + interval * i;
|
|
245
|
-
|
|
246
|
-
Bitmap bitmap;
|
|
247
|
-
try {
|
|
248
|
-
bitmap = mediaMetadataRetriever.getFrameAtTime(frameTime * 1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
|
|
249
|
-
} catch (final Throwable t) {
|
|
250
|
-
// this can happen while thumbnails are being generated in background and we press Cancel
|
|
251
|
-
t.printStackTrace();
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if(bitmap == null) continue;
|
|
256
|
-
try {
|
|
257
|
-
bitmap = Bitmap.createScaledBitmap(bitmap, mThumbWidth * THUMB_RESOLUTION_RES, THUMB_HEIGHT * THUMB_RESOLUTION_RES, false);
|
|
258
|
-
} catch (final Throwable t) {
|
|
259
|
-
t.printStackTrace();
|
|
260
|
-
}
|
|
261
|
-
callback.onSingleCallback(bitmap, (int) interval);
|
|
262
|
-
}
|
|
263
|
-
} catch (final Throwable e) {
|
|
264
|
-
Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
package/ios/VideoTrim.mm
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#import <React/RCTBridgeModule.h>
|
|
2
|
-
#import <React/RCTEventEmitter.h>
|
|
3
|
-
|
|
4
|
-
@interface RCT_EXTERN_MODULE(VideoTrim, RCTEventEmitter)
|
|
5
|
-
|
|
6
|
-
RCT_EXTERN_METHOD(showEditor:(NSString*)uri withConfig:(NSDictionary *)config)
|
|
7
|
-
RCT_EXTERN_METHOD(listFiles:(RCTPromiseResolveBlock)resolve
|
|
8
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
9
|
-
RCT_EXTERN_METHOD(cleanFiles:(RCTPromiseResolveBlock)resolve
|
|
10
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
11
|
-
RCT_EXTERN_METHOD(deleteFile:(NSString*)uri withResolver:(RCTPromiseResolveBlock)resolve
|
|
12
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
13
|
-
RCT_EXTERN_METHOD(closeEditor:(RCTPromiseResolveBlock)resolve
|
|
14
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
|
-
RCT_EXTERN_METHOD(isValidFile:(NSString*)uri withResolver:(RCTPromiseResolveBlock)resolve
|
|
16
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
-
@end
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
// !$*UTF8*$!
|
|
2
|
-
{
|
|
3
|
-
archiveVersion = 1;
|
|
4
|
-
classes = {
|
|
5
|
-
};
|
|
6
|
-
objectVersion = 46;
|
|
7
|
-
objects = {
|
|
8
|
-
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
5E555C0D2413F4C50049A1A2 /* VideoTrim.mm in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* VideoTrim.mm */; };
|
|
11
|
-
F4FF95D7245B92E800C19C63 /* VideoTrim.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* VideoTrim.swift */; };
|
|
12
|
-
/* End PBXBuildFile section */
|
|
13
|
-
|
|
14
|
-
/* Begin PBXCopyFilesBuildPhase section */
|
|
15
|
-
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
16
|
-
isa = PBXCopyFilesBuildPhase;
|
|
17
|
-
buildActionMask = 2147483647;
|
|
18
|
-
dstPath = "include/$(PRODUCT_NAME)";
|
|
19
|
-
dstSubfolderSpec = 16;
|
|
20
|
-
files = (
|
|
21
|
-
);
|
|
22
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
23
|
-
};
|
|
24
|
-
/* End PBXCopyFilesBuildPhase section */
|
|
25
|
-
|
|
26
|
-
/* Begin PBXFileReference section */
|
|
27
|
-
134814201AA4EA6300B7C361 /* libVideoTrim.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libVideoTrim.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
28
|
-
B3E7B5891CC2AC0600A0062D /* VideoTrim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoTrim.mm; sourceTree = "<group>"; };
|
|
29
|
-
F4FF95D5245B92E700C19C63 /* VideoTrim-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VideoTrim-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
30
|
-
F4FF95D6245B92E800C19C63 /* VideoTrim.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoTrim.swift; sourceTree = "<group>"; };
|
|
31
|
-
/* End PBXFileReference section */
|
|
32
|
-
|
|
33
|
-
/* Begin PBXFrameworksBuildPhase section */
|
|
34
|
-
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
35
|
-
isa = PBXFrameworksBuildPhase;
|
|
36
|
-
buildActionMask = 2147483647;
|
|
37
|
-
files = (
|
|
38
|
-
);
|
|
39
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
40
|
-
};
|
|
41
|
-
/* End PBXFrameworksBuildPhase section */
|
|
42
|
-
|
|
43
|
-
/* Begin PBXGroup section */
|
|
44
|
-
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
45
|
-
isa = PBXGroup;
|
|
46
|
-
children = (
|
|
47
|
-
134814201AA4EA6300B7C361 /* libVideoTrim.a */,
|
|
48
|
-
);
|
|
49
|
-
name = Products;
|
|
50
|
-
sourceTree = "<group>";
|
|
51
|
-
};
|
|
52
|
-
58B511D21A9E6C8500147676 = {
|
|
53
|
-
isa = PBXGroup;
|
|
54
|
-
children = (
|
|
55
|
-
F4FF95D6245B92E800C19C63 /* VideoTrim.swift */,
|
|
56
|
-
B3E7B5891CC2AC0600A0062D /* VideoTrim.mm */,
|
|
57
|
-
F4FF95D5245B92E700C19C63 /* VideoTrim-Bridging-Header.h */,
|
|
58
|
-
134814211AA4EA7D00B7C361 /* Products */,
|
|
59
|
-
);
|
|
60
|
-
sourceTree = "<group>";
|
|
61
|
-
};
|
|
62
|
-
/* End PBXGroup section */
|
|
63
|
-
|
|
64
|
-
/* Begin PBXNativeTarget section */
|
|
65
|
-
58B511DA1A9E6C8500147676 /* VideoTrim */ = {
|
|
66
|
-
isa = PBXNativeTarget;
|
|
67
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "VideoTrim" */;
|
|
68
|
-
buildPhases = (
|
|
69
|
-
58B511D71A9E6C8500147676 /* Sources */,
|
|
70
|
-
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
71
|
-
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
72
|
-
);
|
|
73
|
-
buildRules = (
|
|
74
|
-
);
|
|
75
|
-
dependencies = (
|
|
76
|
-
);
|
|
77
|
-
name = VideoTrim;
|
|
78
|
-
productName = RCTDataManager;
|
|
79
|
-
productReference = 134814201AA4EA6300B7C361 /* libVideoTrim.a */;
|
|
80
|
-
productType = "com.apple.product-type.library.static";
|
|
81
|
-
};
|
|
82
|
-
/* End PBXNativeTarget section */
|
|
83
|
-
|
|
84
|
-
/* Begin PBXProject section */
|
|
85
|
-
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
86
|
-
isa = PBXProject;
|
|
87
|
-
attributes = {
|
|
88
|
-
LastUpgradeCheck = 0920;
|
|
89
|
-
ORGANIZATIONNAME = Facebook;
|
|
90
|
-
TargetAttributes = {
|
|
91
|
-
58B511DA1A9E6C8500147676 = {
|
|
92
|
-
CreatedOnToolsVersion = 6.1.1;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "VideoTrim" */;
|
|
97
|
-
compatibilityVersion = "Xcode 3.2";
|
|
98
|
-
developmentRegion = English;
|
|
99
|
-
hasScannedForEncodings = 0;
|
|
100
|
-
knownRegions = (
|
|
101
|
-
English,
|
|
102
|
-
en,
|
|
103
|
-
);
|
|
104
|
-
mainGroup = 58B511D21A9E6C8500147676;
|
|
105
|
-
productRefGroup = 58B511D21A9E6C8500147676;
|
|
106
|
-
projectDirPath = "";
|
|
107
|
-
projectRoot = "";
|
|
108
|
-
targets = (
|
|
109
|
-
58B511DA1A9E6C8500147676 /* VideoTrim */,
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
/* End PBXProject section */
|
|
113
|
-
|
|
114
|
-
/* Begin PBXSourcesBuildPhase section */
|
|
115
|
-
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
116
|
-
isa = PBXSourcesBuildPhase;
|
|
117
|
-
buildActionMask = 2147483647;
|
|
118
|
-
files = (
|
|
119
|
-
F4FF95D7245B92E800C19C63 /* VideoTrim.swift in Sources */,
|
|
120
|
-
B3E7B58A1CC2AC0600A0062D /* VideoTrim.mm in Sources */,
|
|
121
|
-
);
|
|
122
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
123
|
-
};
|
|
124
|
-
/* End PBXSourcesBuildPhase section */
|
|
125
|
-
|
|
126
|
-
/* Begin XCBuildConfiguration section */
|
|
127
|
-
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
128
|
-
isa = XCBuildConfiguration;
|
|
129
|
-
buildSettings = {
|
|
130
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
131
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
132
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
133
|
-
CLANG_ENABLE_MODULES = YES;
|
|
134
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
135
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
136
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
137
|
-
CLANG_WARN_COMMA = YES;
|
|
138
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
139
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
140
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
141
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
142
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
143
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
144
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
145
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
146
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
147
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
148
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
149
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
150
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
151
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
152
|
-
COPY_PHASE_STRIP = NO;
|
|
153
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
154
|
-
ENABLE_TESTABILITY = YES;
|
|
155
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
156
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
157
|
-
GCC_DYNAMIC_NO_PIC = NO;
|
|
158
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
159
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
160
|
-
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
161
|
-
"DEBUG=1",
|
|
162
|
-
"$(inherited)",
|
|
163
|
-
);
|
|
164
|
-
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
165
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
166
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
167
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
168
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
169
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
170
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
171
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
172
|
-
MTL_ENABLE_DEBUG_INFO = YES;
|
|
173
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
174
|
-
SDKROOT = iphoneos;
|
|
175
|
-
};
|
|
176
|
-
name = Debug;
|
|
177
|
-
};
|
|
178
|
-
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
179
|
-
isa = XCBuildConfiguration;
|
|
180
|
-
buildSettings = {
|
|
181
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
182
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
183
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
184
|
-
CLANG_ENABLE_MODULES = YES;
|
|
185
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
186
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
187
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
188
|
-
CLANG_WARN_COMMA = YES;
|
|
189
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
190
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
191
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
192
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
193
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
194
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
195
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
196
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
197
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
198
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
199
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
200
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
201
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
202
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
203
|
-
COPY_PHASE_STRIP = YES;
|
|
204
|
-
ENABLE_NS_ASSERTIONS = NO;
|
|
205
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
206
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
207
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
208
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
209
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
210
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
211
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
212
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
213
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
214
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
215
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
216
|
-
MTL_ENABLE_DEBUG_INFO = NO;
|
|
217
|
-
SDKROOT = iphoneos;
|
|
218
|
-
VALIDATE_PRODUCT = YES;
|
|
219
|
-
};
|
|
220
|
-
name = Release;
|
|
221
|
-
};
|
|
222
|
-
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
223
|
-
isa = XCBuildConfiguration;
|
|
224
|
-
buildSettings = {
|
|
225
|
-
HEADER_SEARCH_PATHS = (
|
|
226
|
-
"$(inherited)",
|
|
227
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
228
|
-
"$(SRCROOT)/../../../React/**",
|
|
229
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
230
|
-
);
|
|
231
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
232
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
233
|
-
PRODUCT_NAME = VideoTrim;
|
|
234
|
-
SKIP_INSTALL = YES;
|
|
235
|
-
SWIFT_OBJC_BRIDGING_HEADER = "VideoTrim-Bridging-Header.h";
|
|
236
|
-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
237
|
-
SWIFT_VERSION = 5.0;
|
|
238
|
-
};
|
|
239
|
-
name = Debug;
|
|
240
|
-
};
|
|
241
|
-
58B511F11A9E6C8500147676 /* Release */ = {
|
|
242
|
-
isa = XCBuildConfiguration;
|
|
243
|
-
buildSettings = {
|
|
244
|
-
HEADER_SEARCH_PATHS = (
|
|
245
|
-
"$(inherited)",
|
|
246
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
247
|
-
"$(SRCROOT)/../../../React/**",
|
|
248
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
249
|
-
);
|
|
250
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
251
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
252
|
-
PRODUCT_NAME = VideoTrim;
|
|
253
|
-
SKIP_INSTALL = YES;
|
|
254
|
-
SWIFT_OBJC_BRIDGING_HEADER = "VideoTrim-Bridging-Header.h";
|
|
255
|
-
SWIFT_VERSION = 5.0;
|
|
256
|
-
};
|
|
257
|
-
name = Release;
|
|
258
|
-
};
|
|
259
|
-
/* End XCBuildConfiguration section */
|
|
260
|
-
|
|
261
|
-
/* Begin XCConfigurationList section */
|
|
262
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "VideoTrim" */ = {
|
|
263
|
-
isa = XCConfigurationList;
|
|
264
|
-
buildConfigurations = (
|
|
265
|
-
58B511ED1A9E6C8500147676 /* Debug */,
|
|
266
|
-
58B511EE1A9E6C8500147676 /* Release */,
|
|
267
|
-
);
|
|
268
|
-
defaultConfigurationIsVisible = 0;
|
|
269
|
-
defaultConfigurationName = Release;
|
|
270
|
-
};
|
|
271
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "VideoTrim" */ = {
|
|
272
|
-
isa = XCConfigurationList;
|
|
273
|
-
buildConfigurations = (
|
|
274
|
-
58B511F01A9E6C8500147676 /* Debug */,
|
|
275
|
-
58B511F11A9E6C8500147676 /* Release */,
|
|
276
|
-
);
|
|
277
|
-
defaultConfigurationIsVisible = 0;
|
|
278
|
-
defaultConfigurationName = Release;
|
|
279
|
-
};
|
|
280
|
-
/* End XCConfigurationList section */
|
|
281
|
-
};
|
|
282
|
-
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
283
|
-
}
|
package/lib/commonjs/index.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.cleanFiles = cleanFiles;
|
|
7
|
-
exports.closeEditor = closeEditor;
|
|
8
|
-
exports.deleteFile = deleteFile;
|
|
9
|
-
exports.isValidFile = isValidFile;
|
|
10
|
-
exports.listFiles = listFiles;
|
|
11
|
-
exports.showEditor = showEditor;
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
const LINKING_ERROR = `The package 'react-native-video-trim' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
14
|
-
ios: "- You have run 'pod install'\n",
|
|
15
|
-
default: ''
|
|
16
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
17
|
-
const VideoTrim = _reactNative.NativeModules.VideoTrim ? _reactNative.NativeModules.VideoTrim : new Proxy({}, {
|
|
18
|
-
get() {
|
|
19
|
-
throw new Error(LINKING_ERROR);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
/**
|
|
23
|
-
* Delete a file
|
|
24
|
-
*
|
|
25
|
-
* @param {string} videoPath: absolute non-empty file path to edit
|
|
26
|
-
* @param {EditorConfig} config: editor configuration
|
|
27
|
-
* @returns {void} A **Promise** which resolves `void`
|
|
28
|
-
*/
|
|
29
|
-
function showEditor(filePath) {
|
|
30
|
-
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31
|
-
const {
|
|
32
|
-
headerTextColor
|
|
33
|
-
} = config;
|
|
34
|
-
const color = (0, _reactNative.processColor)(headerTextColor);
|
|
35
|
-
VideoTrim.showEditor(filePath, {
|
|
36
|
-
...config,
|
|
37
|
-
headerTextColor: color
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Clean output files generated at all time
|
|
43
|
-
*
|
|
44
|
-
* @returns {Promise<string[]>} A **Promise** which resolves to array of files
|
|
45
|
-
*/
|
|
46
|
-
function listFiles() {
|
|
47
|
-
return VideoTrim.listFiles();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Clean output files generated at all time
|
|
52
|
-
*
|
|
53
|
-
* @returns {Promise} A **Promise** which resolves to number of deleted files
|
|
54
|
-
*/
|
|
55
|
-
function cleanFiles() {
|
|
56
|
-
return VideoTrim.cleanFiles();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Delete a file
|
|
61
|
-
*
|
|
62
|
-
* @param {string} filePath: absolute non-empty file path to delete
|
|
63
|
-
* @returns {Promise} A **Promise** which resolves `true` if successful
|
|
64
|
-
*/
|
|
65
|
-
function deleteFile(filePath) {
|
|
66
|
-
if (!(filePath !== null && filePath !== void 0 && filePath.trim().length)) {
|
|
67
|
-
throw new Error('File path cannot be empty!');
|
|
68
|
-
}
|
|
69
|
-
return VideoTrim.deleteFile(filePath);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Close editor
|
|
74
|
-
*/
|
|
75
|
-
function closeEditor() {
|
|
76
|
-
return VideoTrim.closeEditor();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Check if a file is valid audio or video file
|
|
81
|
-
*
|
|
82
|
-
* @returns {Promise} A **Promise** which resolves file info if successful
|
|
83
|
-
*/
|
|
84
|
-
function isValidFile(url) {
|
|
85
|
-
return VideoTrim.isValidFile(url);
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","VideoTrim","NativeModules","Proxy","get","Error","showEditor","filePath","config","arguments","length","undefined","headerTextColor","color","processColor","listFiles","cleanFiles","deleteFile","trim","closeEditor","isValidFile","url"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,MAAMC,aAAa,GAChB,kFAAiF,GACl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