import UIKit
import VideoEditorSDK
class VideoFocusConfigurationSwift: Example, VideoEditViewControllerDelegate {
override func invokeExample() {
let video = Video(url: Bundle.main.url(forResource: "Skater", withExtension: "mp4")!)
let configuration = Configuration { builder in
builder.configureFocusToolController { options in
options.allowedFocusModes = [.off, .radial, .linear]
}
}
let videoEditViewController = VideoEditViewController(videoAsset: video, configuration: configuration)
videoEditViewController.delegate = self
videoEditViewController.modalPresentationStyle = .fullScreen
presentingViewController?.present(videoEditViewController, animated: true, completion: nil)
}
func videoEditViewControllerShouldStart(_ videoEditViewController: VideoEditViewController, task: VideoEditorTask) -> Bool {
true
}
func videoEditViewControllerDidFinish(_ videoEditViewController: VideoEditViewController, result: VideoEditorResult) {
presentingViewController?.dismiss(animated: true, completion: nil)
}
func videoEditViewControllerDidFail(_ videoEditViewController: VideoEditViewController, error: VideoEditorError) {
print(error.localizedDescription)
presentingViewController?.dismiss(animated: true, completion: nil)
}
func videoEditViewControllerDidCancel(_ videoEditViewController: VideoEditViewController) {
presentingViewController?.dismiss(animated: true, completion: nil)
}
}