react-native-video-trim 6.0.8 → 6.0.10
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/ios/VideoTrim.swift +8 -8
- package/package.json +1 -1
package/ios/VideoTrim.swift
CHANGED
|
@@ -211,8 +211,6 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
211
211
|
|
|
212
212
|
@objc public weak var delegate: VideoTrimProtocol?
|
|
213
213
|
@objc public var isNewArch = false
|
|
214
|
-
|
|
215
|
-
|
|
216
214
|
|
|
217
215
|
// MARK: for old arch
|
|
218
216
|
private var hasListeners = false
|
|
@@ -545,10 +543,11 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
545
543
|
|
|
546
544
|
// Handle removeAfterSavedToPhoto
|
|
547
545
|
if let removeAfterSaved = config["removeAfterSavedToPhoto"] as? Bool, removeAfterSaved {
|
|
548
|
-
let _ = VideoTrim.deleteFile(url: outputFile
|
|
546
|
+
let _ = VideoTrim.deleteFile(url: outputFile)
|
|
549
547
|
}
|
|
550
548
|
|
|
551
549
|
let result = [
|
|
550
|
+
"success": true,
|
|
552
551
|
"outputPath": outputFile.absoluteString,
|
|
553
552
|
"startTime": startTime,
|
|
554
553
|
"endTime": endTime,
|
|
@@ -561,7 +560,7 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
561
560
|
|
|
562
561
|
// Handle removeAfterFailedToSavePhoto
|
|
563
562
|
if let removeAfterFailed = config["removeAfterFailedToSavePhoto"] as? Bool, removeAfterFailed {
|
|
564
|
-
let _ = VideoTrim.deleteFile(url: outputFile
|
|
563
|
+
let _ = VideoTrim.deleteFile(url: outputFile)
|
|
565
564
|
}
|
|
566
565
|
|
|
567
566
|
let result = [
|
|
@@ -578,7 +577,7 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
578
577
|
|
|
579
578
|
// Handle removeAfterFailedToSavePhoto
|
|
580
579
|
if let removeAfterFailed = config["removeAfterFailedToSavePhoto"] as? Bool, removeAfterFailed {
|
|
581
|
-
let _ = VideoTrim.deleteFile(url: outputFile
|
|
580
|
+
let _ = VideoTrim.deleteFile(url: outputFile)
|
|
582
581
|
}
|
|
583
582
|
|
|
584
583
|
let result = [
|
|
@@ -593,6 +592,7 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
593
592
|
} else {
|
|
594
593
|
// For audio files, we can't save to photo library, just return success
|
|
595
594
|
let result = [
|
|
595
|
+
"success": true,
|
|
596
596
|
"outputPath": outputFile.absoluteString,
|
|
597
597
|
"startTime": startTime,
|
|
598
598
|
"endTime": endTime,
|
|
@@ -603,6 +603,7 @@ public class VideoTrim: RCTEventEmitter, AssetLoaderDelegate, UIDocumentPickerDe
|
|
|
603
603
|
}
|
|
604
604
|
} else {
|
|
605
605
|
let result = [
|
|
606
|
+
"success": true,
|
|
606
607
|
"outputPath": outputFile.absoluteString,
|
|
607
608
|
"startTime": startTime,
|
|
608
609
|
"endTime": endTime,
|
|
@@ -1013,9 +1014,8 @@ extension VideoTrim {
|
|
|
1013
1014
|
@objc(isValidFile:withResolver:withRejecter:)
|
|
1014
1015
|
func isValidFile(uri: String, resolve: @escaping RCTPromiseResolveBlock,reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
1015
1016
|
VideoTrim.isValidFile(url: uri, completion: { payload in
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
)
|
|
1017
|
+
resolve(payload)
|
|
1018
|
+
})
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
1021
|
private static func checkFileValidity(url: URL, completion: @escaping (Bool, String, Double) -> Void) {
|