Video Editor API includes 2 main core modules
Playback API
Export API
VideoPlayer is a core of Playback API. VideoPlayer
is implemented in a similar way like other media players.
Main concepts
- Add video playlist you want to play
- Manage actions i.e. play, pause, change volume etc.
- Manage effects
- Handle events
Understanding these concepts can help you to implement any number of use cases. For example,
- Video trimming - allow the user to trim, merge any number of video sources
- Cover image selection - allow the user to select a video frame as a preview.
- Video editing - allow the user to edit video by adding various number of effects, audio
Visit Playback API quickstart to quickly integrate API into your project.
ExportFlowManager amd ExportParamProvider are core of Export API. With Export API you can easily to make any number of video files with various effects and audio.
Supported Features
- Any number of video in various resolutions
- Video with any number of various effects
- A separate audio file
- Slideshow - video made of images
- A GIF preview of a video
Visit Export API quickstart to quickly integrate API into your project.
- Koin
- ExoPlayer
- Kotlin Coroutines
- AndroidX libraries
- See all
GitHub packages is used for getting Android Video Editor API modules.
Add repositories to your project gradle file in allprojects
section to get SDK dependencies.
...
allprojects {
repositories {
...
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Banuba/banuba-ve-sdk")
credentials {
username = "Banuba"
password = "\u0038\u0036\u0032\u0037\u0063\u0035\u0031\u0030\u0033\u0034\u0032\u0063\u0061\u0033\u0065\u0061\u0031\u0032\u0034\u0064\u0065\u0066\u0039\u0062\u0034\u0030\u0063\u0063\u0037\u0039\u0038\u0063\u0038\u0038\u0066\u0034\u0031\u0032\u0061\u0038"
}
}
maven {
name "GitHubPackagesEffectPlayer"
url "https://maven.pkg.github.com/sdk-banuba/banuba-sdk-android"
credentials {
username = "sdk-banuba"
password = "\u0067\u0068\u0070\u005f\u004a\u0067\u0044\u0052\u0079\u0049\u0032\u006d\u0032\u004e\u0055\u0059\u006f\u0033\u0033\u006b\u0072\u0034\u0049\u0069\u0039\u0049\u006f\u006d\u0077\u0034\u0052\u0057\u0043\u0064\u0030\u0052\u0078\u006d\u0045\u0069"
}
}
...
}
}
Next, add a list of API dependencies in app/build.gradle file.
def banubaSdkVersion = '1.39.0'
implementation "com.banuba.sdk:ffmpeg:5.1.3"
implementation "com.banuba.sdk:core-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-playback-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-export-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-effects-sdk:${banubaSdkVersion}"
// Only if you use Banuba Face AR
implementation "com.banuba.sdk:effect-player-adapter:${banubaSdkVersion}"
Custom behavior of Video Editor API is implemented by using dependency injection framework Koin.
Next, create new class VideoEditorApiModule for implementing Video Editor API and add all required API modules.
class VideoEditorApiModule {
fun initialize(application: Application) {
startKoin {
androidContext(application)
allowOverride(true)
modules(
VeSdkKoinModule().module,
VeExportKoinModule().module,
VePlaybackSdkKoinModule().module,
// Module is required for applying Face AR masks
BanubaEffectPlayerKoinModule().module,
SampleModule().module
)
}
}
}
Create new class SampleModule to provide custom implementation for API in module variable.
private class SampleModule {
+ val module = module {
...
}
}
Finally, initialize VideoEditorApiModule
in your Application class.
BanubaVideoEditor
is a core class of API and SDK for initializing the product with the license token.
Instance videoEditor
is null
when the license token is incorrect i.e. empty, truncated.
class SampleApp : Application() {
override fun onCreate() {
super.onCreate()
val videoEditor = BanubaVideoEditor.initialize(LICENSE_TOKEN)
if (videoEditor == null) {
// Token is not correct. Please check the license token
} else {
// Initialize API modules
VideoEditorApiModule().initialize(this@SampleApp)
}
}
}
It is highly recommended to check your license state before using API functionalities.
Use BanubaVideoEditor.getLicenseState
method for checking the license state in your Activity or Fragment.
videoEditor.getLicenseState { isValid ->
if (isValid) {
// ✅ License is active, all good
} else {
// ❌ Use of Video Editor is restricted. License is revoked or expired.
}
}
We highly recommend to learn Playback API quickstart and Export API quickstart guides to streamline your integration process.