Skip to main content
VESDK/Flutter/Guides

Native Interfaces

Learn how to use our native interfaces for customizing the VideoEditor for Flutter on iOS and Android.

VideoEditor SDK for Flutter has some dedicated native interfaces build-in to provide better access and customization possibilities. These interfaces are accessible via the FlutterVESDK class.

iOS#

On iOS, there are two interfaces available - one for adjusting the native Configuration and one to have access to the active VideoEditViewController - before the editor is opened.

Before using any of the native interfaces described below, you need to import the native module:

import ImglyKit

configureWithBuilder#

The FlutterVESDK.configureWithBuilder function allows you to modify the native Configuration before it gets passed to the editor. You can make all kinds of adjustments here that are not possible from the React Native configuration, e.g., change buttons or use closures of individual tools. For further information, please have a look at the dedicated native guides.

FlutterVESDK.configureWithBuilder = { builder in
// Disable the color pipette for the text color selection tool
builder.configureTextColorToolController { options in
var colors = options.availableColors
// Remove first color item which is the color pipette
colors.remove(at: 0)
options.availableColors = colors
}
}

willPresentVideoEditViewController#

The FlutterVESDK.willPresentVideoEditViewController function is called right before the video editor is presented and allows you to make adjustments directly to the editor.

FlutterVESDK.willPresentVideoEditViewController = { videoEditViewController in
print("Will present:", videoEditViewController)
}

Android#

On Android, there are also two interfaces available - one for adjusting the native SettingsList before the editor is opened and one to have access to the StateHandler before the editor exports the video. All native interfaces can be accessed within the MainActivity.kt of your application. To do so, you need to override the onStart method and use our interfaces to apply your customizations as shown below:

editorWillOpenClosure#

The FlutterVESDK.editorWillOpenClosure is called right before the editor is opened. Within this closure, you can make adjustments to the native VideoEditorSettingsList and apply customizations of various kinds. For further information on this, please refer to our native guides.

FlutterVESDK.editorWillOpenClosure = { settingsList ->
settingsList.configure<UiConfigText> {
// Remove first color item which is the color pipette
it.textColorList.removeFirst()
}
}

editorWillExportClosure#

The FlutterVESDK.editorWillExportClosure is called right before the serialization is applied when the editor starts exporting. Within this closure, you can make adjustments to the native StateHandler and apply customizations of various kinds. For further information on this, please refer to our native guides.

FlutterVESDK.editorWillExportClosure = {
// Set a custom trim time
it[TrimSettings::class].setStartTime(2, TimeUnit.SECONDS)
it[TrimSettings::class].setEndTime(3, TimeUnit.SECONDS)
}