VideoEditor SDK supports exporting videos in the background using
WorkManager. Background export requires the
backend:headless module. Refer to our documentation on how to include the module in your project.
For the sake of this example, we load a video from the resources into the video editor.
VideoEditorSaveSettings to set the
outputMode to only export the
SettingsList (instead of the video). This
SettingsList will be used later to export the video in the background.
The result from the editor is received in the
EditorSDKResult wraps around the intent and provides a convenient API to check the result. Here, we obtain the
EditorSDKResult.settingsList and create a
WorkRequest using the
DocumentRenderWorker.createWorker() method. This
WorkRequest is then enqueued in the
WorkManager for background processing.
Note the usage of the
use() method on the
SettingsList. It automatically releases the
SettingsList after executing the block so we don't have to release it manually.