react-native-video-trim 1.0.20 → 1.0.21
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 +7 -1
- package/package.json +1 -1
package/ios/VideoTrim.swift
CHANGED
|
@@ -275,7 +275,13 @@ class VideoTrim: RCTEventEmitter {
|
|
|
275
275
|
let timestamp = Int(Date().timeIntervalSince1970)
|
|
276
276
|
let outputName = "\(FILE_PREFIX)_\(timestamp).mp4" // use mp4 to prevent any issue with ffmpeg about file extension
|
|
277
277
|
let outputFile = "\(inputFile.deletingLastPathComponent().absoluteURL)\(outputName)"
|
|
278
|
-
|
|
278
|
+
|
|
279
|
+
let formatter = DateFormatter()
|
|
280
|
+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ"
|
|
281
|
+
formatter.timeZone = TimeZone(identifier: "UTC")
|
|
282
|
+
let dateTime = formatter.string(from: Date())
|
|
283
|
+
|
|
284
|
+
let cmd = "-ss \(startTime * 1000)ms -to \(endTime * 1000)ms -i \(inputFile) -c copy -metadata creation_time=\(dateTime) \(outputFile)";
|
|
279
285
|
|
|
280
286
|
self.emitEventToJS("onStartTrimming", eventData: nil)
|
|
281
287
|
|