Language:
Configure Overlays
VideoEditor SDK supports several configuration options for the OverlayToolPanel
allowing flexible adaptation to different needs and use cases.
Set initial overlay#
Here, we set an initial overlay that will be applied to the input video. We find the OverlayAsset
to apply by using the getAssetById()
method on the AssetConfig
which we obtain from the SettingsList
.
Intensity and BlendMode#
For the sake of this example, we set the intensity
to 0.4 and the blendMode
to HARD_LIGHT
.
File:
class VideoOverlayConfiguration(private val activity: AppCompatActivity) : Example(activity) {override fun invoke() {// In this example, we do not need access to the Uri(s) after the editor is closed// so we pass false in the constructorval settingsList = VideoEditorSettingsList(false)// Set the source as the Uri of the video to be loaded.configure<LoadSettings> {it.source = activity.resourceUri(R.raw.skater)}settingsList.configure<OverlaySettings> {it.overlayAsset = checkNotNull(settingsList.config.getAssetById(OverlayAsset::class, "imgly_overlay_vintage"))it.intensity = 0.4fit.blendMode = BlendMode.HARD_LIGHT}// Start the video editor using VideoEditorBuilder// The result will be obtained in onActivityResult() corresponding to EDITOR_REQUEST_CODEVideoEditorBuilder(activity).setSettingsList(settingsList).startActivityForResult(activity, EDITOR_REQUEST_CODE)// Release the SettingsList once donesettingsList.release()}override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {intent ?: returnif (requestCode == EDITOR_REQUEST_CODE) {// Wrap the intent into an EditorSDKResultval result = EditorSDKResult(intent)when (result.resultStatus) {EditorSDKResult.Status.CANCELED -> showMessage("Editor cancelled")EditorSDKResult.Status.EXPORT_DONE -> showMessage("Result saved at ${result.resultUri}")else -> {}}}}}