From 061275029e0994b03f11372a0333af98ba972376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Rodri=CC=81guez?= Date: Fri, 29 Oct 2021 09:15:17 +0200 Subject: [PATCH] Sanitize input config --- SimpleSessionExporter.swift | 8 ++++++++ ios/Plugin/VideoEditorPlugin.swift | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 SimpleSessionExporter.swift diff --git a/SimpleSessionExporter.swift b/SimpleSessionExporter.swift new file mode 100644 index 0000000..c7c5e92 --- /dev/null +++ b/SimpleSessionExporter.swift @@ -0,0 +1,8 @@ +// +// SimpleSessionExporter.swift +// CapacitorPluginVideoEditor +// +// Created by Manuel Rodríguez on 28/10/21. +// + +import Foundation diff --git a/ios/Plugin/VideoEditorPlugin.swift b/ios/Plugin/VideoEditorPlugin.swift index ce4e3e9..aa65587 100644 --- a/ios/Plugin/VideoEditorPlugin.swift +++ b/ios/Plugin/VideoEditorPlugin.swift @@ -11,7 +11,7 @@ public class VideoEditorPlugin: CAPPlugin { private let implementation = VideoEditor() @objc func edit(_ call: CAPPluginCall) { - let path = call.getString("path"); + let path = call.getString("path")?.replacingOccurrences(of: "file://", with: ""); let trim = call.getObject("trim") ?? JSObject(); let transcode = call.getObject("transcode") ?? JSObject(); @@ -22,8 +22,8 @@ public class VideoEditorPlugin: CAPPlugin { do { let trimSettings = try TrimSettings( - startsAt: (trim["startsAt"] ?? 0) as! Int , - endsAt: (trim["endsAt"] ?? 0) as! Int + startsAt: (trim["startsAt"] ?? 0.0) as! Double, + endsAt: (trim["endsAt"] ?? 0.0) as! Double ); let transcodeSettings = try TranscodeSettings(