Skip to main content
Language

To Camera Roll

VideoEditor SDK supports saving videos to the camera roll.

Import media library#

To retrieve access to the device's camera roll, we need to install and import the expo-media-library module. For further reference on how to set this up, please take a look at the official documentation.

Set an accessible export path#

Since we are using the expo-file-system module for deleting the exported video after processing it, we need to save the video in one of the directories that are supported by this module. Otherwise, the module will not be able to delete the files. For further reference on this, please have a look at the official documentation. Please note that you need to specify the file extension for Android, while it is automatically added for iOS.

Open the editor and handle the result#

Open the video editor and handle the export result.

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.video 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 configuration.export.force to true, in which case result.video will always point to a newly generated video.

Save the video to the camera roll#

To save the exported video to the camera roll, open the editor and handle the export result. Then, use the expo-media-library to save the VideoEditorResult.video.

Delete the temporary video#

Delete the temporary export file after processing the video.