Skip to main content
VESDK/Android/Introduction

Migration from v9

Look for a straightforward migration of the VideoEditor SDK v9.

1. Update the Plugin to v10#

Simply update the plugin version. Make sure to include the IMG.LY Maven repository if you haven't already.

// Add the VESDK repository and plugin dependency
buildscript {
repositories {
google()
gradlePluginPortal()
maven { url 'https://artifactory.img.ly/artifactory/imgly' }
}
dependencies {
// Insert the latest SDK version number here. You will find it here https://github.com/imgly/pesdk-android-demo/releases
classpath 'ly.img.android.pesdk:plugin:10.2.1'
// Add the Kotlin plugin
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.32'
}
}
allprojects {
repositories {
mavenCentral()
google()
maven { url 'https://artifactory.img.ly/artifactory/imgly' }
}
}

2. Dropping Jelly Bean and KitKat support#

VideoEditor SDK v10 removed support for running on Android Jelly Bean and KitKat (API 16 - 20) devices. The new minimum supported Android version is 5.0 Lollipop (API 21).

Update your project's minSdkVersion to at-least 21 to use VideoEditor SDK v10.

3. compileSdkVersion & buildToolsVersion Update#

We have updated the SDK's compileSdkVersion to 31 and buildToolsVersion to 31.0.0. We would recommend you to use the same versions or higher in your project.

4. AppCompat Migration#

VideoEditorActivity and CameraPreviewActivity now extends from AppCompatActivity.

If you were previously using your own Activity with our Editor, make sure to extend from AppCompatActivity.

5. Changes to Themes#

All our themes now extend from Theme.AppCompat.

We have also renamed all our themes to follow a consistent naming scheme. Our default theme PESDKMobileUIDefaultTheme has been renamed to Theme.Imgly. All other themes starting with Imgly.Theme have been renamed to start with Theme.Imgly.

6. Dropping Kotlin 1.4 support#

VideoEditor SDK v10 now uses Kotlin version 1.5.32. This means we do not support Kotlin version 1.4 anymore. Consider updating your project's Kotlin version to at-least 1.5.32.

7. Changed SettingsList constructor for permission handling#

Due to security changes in the Android platform, we have to work around Uri permission handling. Thus, it is necessary for you to decide if the read permission of the Uri references in the SettingsList need to be retained after the Editor is closed.

Check if you need to access the Uris in the SettingsList returned by the Editor, in your Activity's result. This is true, for example, if you wish to use IMGLYFileWriter or DocumentRenderWorker. To enable this, you have to create your initial SettingsList that you use to start the Editor with VideoEditorSettingsList(true). The Editor will then copy all Uris with read permission, in a background thread to the app's temporary directory.

If you do not need this feature, for example, because you do not access the SettingsList returned by the Editor, you should create your SettingsList with VideoEditorSettingsList(false) instead.

8. SettingsList must be released. It's a strict requirement!#

The SettingsList needs to be released by the creator, after passing it to one or more consumer. If the consumer needs to hold a reference to the SettingsList, the consumer should store a parcel-ed version of the SettingsList.

Example Code 1. Handle SDK start.

// Create a SettingsList
// -> You are the creator, you have to release it later!
val settingsList = VideoEditorSettingsList(true)
// Pass it to the VideoEditorBuilder, which consumes the settingsList by creating a copy of it.
VideoEditorBuilder(this@MainActivity)
.setSettingsList(settingsList)
.startActivityForResult(this@MainActivity, EDITOR_ACTIVITY_RESULT)
// Because you are the creator, you now have to release the SettingsList.
settingsList.release()

Example Code 2. Handle SDK result.

// Create a wrapped editor intent result.
val editorResult = EditorSDKResult(intent)
// With accessing the SettingsList, the SettingList is created from the Intent.
// -> You are the creator, you have to release it later!
val settingList = editorResult.settingsList
// You can use this SettingsList, to write a Serialization (IMGLYFileWriter is the consumer).
// But because all IMGLYFileWriter write methods are synchronous calls, IMGLYFileWriter does not create a copy of the SettingsList! (Holding a Reference to the IMGLYFileWriter for later use, after `SettingsList` is released will not work)
IMGLYFileWriter(settingsList).writeJson(myFile)
// You can also use the same SettingsList with the DocumentRenderWorker to start a background export.
// Because DocumentRenderWorker is asynchronous, the `DocumentRenderWorker.createWorker(settingList)` call creates a copy of the SettingsList.
WorkManager.getInstance(this).enqueue(DocumentRenderWorker.createWorker(settingsList))
// Because you are still the creator, you now have to release your instance of the SettingsList.
// (DocumentRenderWorker will do the same with its version of the SettingsList internally)
settingsList.release()

If you forget to release the SettingList, the Editor will log an error in the console with some delay.

9. Nullability Changes#

The signature of following functions/constructors have been changed to correctly reflect the nullability of their parameters -

  • ImglyIntent::startActivityForBroadcast()
  • VideoEditorBuilder::startActivityForBroadcast() and VideoEditorBuilder::startActivityForResult()
  • EditorBuilder and its subclasses' constructors.

10. Deprecations#

  • ly.img.android.pesdk.backend.model.state.VideoCompositionSettings.VideoPart in favor of ly.img.android.pesdk.backend.model.VideoPart.
  • VideoCompositionSettings.Event.VIDEO_SELECTED in favor of VideoState.Event.VIDEO_SELECTED.
  • RoxOperation::onReleaseOperator() renamed to RoxOperation::onOperatorReleased().
  • VideoEditorBuilder::startActivityForBroadcast() is now obsolete. We replaced it with WorkManager Worker created with DocumentRenderWorker.createWorker(settingsList).