Skip to content

Commit

Permalink
Sanitize input config
Browse files Browse the repository at this point in the history
  • Loading branch information
dragermrb committed Oct 29, 2021
1 parent b1b1b25 commit 0612750
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions SimpleSessionExporter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// SimpleSessionExporter.swift
// CapacitorPluginVideoEditor
//
// Created by Manuel Rodríguez on 28/10/21.
//

import Foundation
6 changes: 3 additions & 3 deletions ios/Plugin/VideoEditorPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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(
Expand Down

0 comments on commit 0612750

Please sign in to comment.