This guide walks you through integrating the Android Video Editor SDK into your React Native project. Integration and customization are performed in the android directory using native Android development practices.
- Installation
- Resources
- AndroidManifest Updates
- Koin Module Setup
- Launch
- Editor V2
- Face AR Effects
- Connect audio
Add the Banuba repository to your project using either Groovy or Kotlin DSL:
Groovy (in project's build.gradle)
...
allprojects {
repositories {
...
maven {
name = "nexus"
url = uri("https://nexus.banuba.net/repository/maven-releases")
}
}
}or
Kotlin (settings.gradle.kts)
...
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven {
name = "nexus"
url = uri("https://nexus.banuba.net/repository/maven-releases")
}
}
}Specify packagingOptions in your build gradle:
android {
...
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
...
}Add dependencies to your app's gradle
def banubaSdkVersion = '1.51.0'
implementation "com.banuba.sdk:ffmpeg:5.3.0"
implementation "com.banuba.sdk:camera-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:camera-ui-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:core-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:core-ui-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-flow-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-ui-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-gallery-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-effects-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:effect-player-adapter:${banubaSdkVersion}"
implementation "com.banuba.sdk:ar-cloud:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-audio-browser-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-export-sdk:${banubaSdkVersion}"
implementation "com.banuba.sdk:ve-playback-sdk:${banubaSdkVersion}"Ensure these plugins are in your app's gradle.
plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-parcelize"
}Add the following to your AndroidManifest.xml:
VideoCreationActivity– orchestrates the video editor screens
<activity android:name="com.banuba.sdk.ve.flow.VideoCreationActivity"
android:screenOrientation="portrait"
android:theme="@style/VideoCreationTheme"
android:windowSoftInputMode="adjustResize"
tools:replace="android:theme" />- Network permissions (optional)– only required if using Giphy stickers or downloading AR effects from the cloud.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />Note: You'll also need a custom VideoCreationTheme example to style the editor UI.
Please set up correctly network security config and use of android:usesCleartextTraffic
by following guide.
- Create VideoEditorIntegrationModule to initialize and customize the Video Editor SDK.
- Inside it, add SampleModule with your customizations:
class VideoEditorIntegrationModule {
...
fun initialize(applicationContext: Context) {
startKoin {
androidContext(applicationContext)
allowOverride(true)
// IMPORTANT! order of modules is required
modules(
VeSdkKoinModule().module,
VeExportKoinModule().module,
VePlaybackSdkKoinModule().module,
// Use AudioBrowserKoinModule ONLY if your contract includes this feature.
AudioBrowserKoinModule().module,
// IMPORTANT! ArCloudKoinModule should be set before TokenStorageKoinModule to get effects from the cloud
ArCloudKoinModule().module,
VeUiSdkKoinModule().module,
VeFlowKoinModule().module,
BanubaEffectPlayerKoinModule().module,
GalleryKoinModule().module,
// Sample integration module
+ SampleModule().module,
)
}
}
}
+ private class SampleModule {
val module = module {
single<ArEffectsRepositoryProvider>(createdAtStart = true) {
ArEffectsRepositoryProvider(
arEffectsRepository = get(named("backendArEffectsRepository"))
)
}
// Audio Browser provider implementation.
single<ContentFeatureProvider<TrackData, Fragment>>(
named("musicTrackProvider")
) {
if (VideoEditorIntegrationModule.CONFIG_ENABLE_CUSTOM_AUDIO_BROWSER) {
AudioBrowserContentProvider()
} else {
// Default implementation that supports Local audio stored on the device
AudioBrowserMusicProvider()
}
}
}
}The Video Editor SDK exports a single video with auto quality by default. Auto quality is based on device hardware capabilities.
Every exported media is passed to the onActivityResult method in MainActivity.kt. Process the result there and forward it to the handler on React Native side.
Create SdkEditorModule for communicating with the SDK.
Create BanubaSdkReactPackage class add add SdkEditorModule to the list of modules.
class BanubaSdkReactPackage : ReactPackage {
class BanubaSdkReactPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): MutableList<NativeModule> {
val modules = mutableListOf<NativeModule>()
+ modules.add(SdkEditorModule(reactContext))
return modules
}
override fun createViewManagers(reactContext: ReactApplicationContext): MutableList<ViewManager<View, ReactShadowNode<*>>> =
mutableListOf()
}
}Add BanubaSdkReactPackage package in the application
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> = PackageList(this).packages.apply {
+ add(BanubaSdkReactPackage())
}
...
}
override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
...
}
}The Promises pattern bridges React Native with Android native modules.
On the React Native side, call initSDK to initialize the SDK with your license token:
SdkEditorModule.initSDK(LICENSE_TOKEN);On the Android side, implement the ReactMethod that initializes the Video Editor SDK.
After SDK initialization, invoke openVideoEditor from React Native to start Video Editor:
await SdkEditorModule.openVideoEditor();On the Android side, implement the ReactMethod to start Video Editor.
@ReactMethod
fun openVideoEditor(promise: Promise) {
checkLicenseVideoEditor(callback = { isValid ->
if (isValid) {
// ✅ The license is active
val hostActivity = currentActivity
if (hostActivity == null) {
// Activity is not connected
} else {
this.resultPromise = promise
val intent = VideoCreationActivity.startFromCamera(
hostActivity,
PipConfig(video = Uri.EMPTY, openPipSettings = false),
extras = extras
)
hostActivity.startActivityForResult(intent, OPEN_VIDEO_EDITOR_REQUEST_CODE)
}
} else {
// ❌ Use of SDK is restricted: the license is revoked or expired
}
}, onError = {
// Verify license
})
}Important
- Returns
nulll if the license token is invalid – verify your token - Check license activation before starting the editor.
- Expired/revoked licenses show a "Video content unavailable" screen
To keep up with the latest developments and best practices, our team has completely redesigned the Video Editor SDK to be as convenient and enjoyable as possible.
Create Bundle with Editor UI V2 configuration and pass extras to any Video Editor start method.
val extras = bundleOf(
"EXTRA_USE_EDITOR_V2" to true
)Banuba Face AR SDK product is used on camera and editor screens for applying various AR effects while making video content. Any Face AR effect is a folder that includes a number of files required for Face AR SDK to play this effect.
Note
Make sure preview.png file is included in effect folder. You can use this file as a preview for AR effect.
There are 3 options for adding and managing AR effects:
- Store all effects by the path assets/bnb-resources/effects folder in the app.
- Store color effects in assets/bnb-resources/luts folder in the app.
- Use AR Cloud for storing effects on a server.
This section describes how to connect custom audio tracks to the Video Editor SDK. This is an optional step in the integration process.
Video Editor SDK allows to implement your experience of providing your audio tracks using External Audio API.
For a quick demonstration of this flow on React Native, you can enable the pre-configured custom audio browser
by setting CONFIG_ENABLE_CUSTOM_AUDIO_BROWSER to true in VideoEditorIntegrationModule.kt.
Important
The Video Editor SDK can only play audio tracks that are stored locally on the device. You are responsible for downloading or providing the audio file to the correct local path before applying it.
For complete implementation details, including how to build a custom UI and handle audio selection callbacks, refer to the dedicated Audio Content guide.
To use audio tracks from Soundstripe in the Video Editor:
-
Set CONFIG_ENABLE_CUSTOM_AUDIO_BROWSER to
falseinVideoEditorIntegrationModule.kt -
Specify
SoundstripeProviderin your VideoEditorIntegrationModule:
Important
This feature is not activated by default. Contact Banuba representatives for access.
single<ContentFeatureProvider<TrackData, Fragment>>(named("musicTrackProvider")){
SoundstripeProvider()
}To use audio tracks from Banuba Music in the Video Editor:
- Set CONFIG_ENABLE_CUSTOM_AUDIO_BROWSER to
falseinVideoEditorIntegrationModule.kt - Specify
BanubaMusicProviderin your VideoEditorIntegrationModule:
Important
This feature is not activated by default. Contact Banuba representatives for access.
single<ContentFeatureProvider<TrackData, Fragment>>(named("musicTrackProvider")){
BanubaMusicProvider()
}Explore the full capabilities of our Video Editor SDK