Skip to main content

Launching from UIKit

Configuration

The custom behavior of the Video Editor SDK in your app is implemented using a number of configuration classes. VideoEditorConfig is the main entity used for the Video Editor configuration:

class VideoEditorModule {
func createConfiguration() -> VideoEditorConfig {
var config = VideoEditorConfig()
...
return config
}
}

Check out the demo project for an example of creating VideoEditorConfig.

Launch

Create an instance of BanubaVideoEditor with the license token:

let videoEditorSDK = BanubaVideoEditor(
token: AppDelegate.licenseToken,
configuration: config,
externalViewControllerFactory: viewControllerFactory
)

videoEditorSDK is nil when the license token is incorrect i.e. empty, truncated. If videoEditorSDK is not nil, you can proceed and start the Video Editor.

Next, we strongly recommend checking your license state before starting the Video Editor:

videoEditorSDK?.getLicenseState(
completion: { [weak self] isValid in
if isValid {
print("✅ License is active, all good")
} else {
print("❌ License is either revoked or expired")
}
...
completion(isValid)
}
)
danger

The "Video content unavailable" screen will appear if the user starts the Video Editor SDK with a revoked or expired license:

The following implementation starts the Video Editor from the camera screen:

let cameraLaunchConfig = VideoEditorLaunchConfig(
entryPoint: .camera,
hostController: self,
musicTrack: nil, // Paste a music track as a track preset at the camera screen to record video with music
animated: true
)

videoEditorModule.presentVideoEditor(with: cameraLaunchConfig)

The Video Editor supports multiple launch methods described in this guide.

Implementing export

The Video Editor can export multiple media files to meet your requirements.
Create an instance of ExportConfiguration and provide Array<ExportVideoConfiguration> where every ExportVideoConfiguration is a media file i.e. video or audio. Next, use BanubaVideoEditor.export() method and pass the instance of ExportConfiguration to start the export.

Please, check out the export implementation in the sample. Learn the Export integration guide to know more about exporting media content features.