To File System
VideoEditor SDK supports saving videos to the file system.
For the sake of this example, we create a video from a URL and present the video editor in a modal.
Note, that we have to make the current class the delegate of the
VideoEditViewController in order to handle export and cancellation there.
Implementing the Video Export Delegate Method#
When a video export is successful the method
videoEditViewControllerDidFinish is invoked on the delegate class and a
VideoEditorResult object is passed as an argument.
If no modifications have been made to the original video, we will not process the original video at all
and also not reencode it. In this case,
result.output.url will point to the original video that was passed to the editor, if available.
If you want to ensure that the original video is always reencoded, even if no modifications have
been made to it, you can set
true, in which case
always point to a newly generated video.
You can further process the video using the
url, once you are finished we recommend that you delete the temporary file.
Here, we first check whether the video file was passed without changes. This check is only necessary when working with the Simulator, since in production the app bundle is read-only.