Android · Kotlin
An Android video editor SDK, in your app and your brand
Add a complete video editor to your Android app in Kotlin: a real-time preview, a timeline with tools and panels, text, effects, music and MP4 export. Two views in your Activity, one line in Gradle, and your users never leave your app.
What your users get
A timeline made for a phone
The playhead stays in the middle and the video scrolls under it. The tool bar follows the selection.
A preview users touch
Tap a layer to select it; drag, pinch or use its handles to move, resize and rotate it.
Cuts, speed and looks
Trim, split and change speed; looks, adjustments and effects on a clip; transitions between clips.
Titles that move
Text with built-in styles and in, out and loop animations, plus keyframes for anything animatable.
Music and voice
Audio tracks with volume, voice and audio effects.
Undo, redo, reopen
Every edit can be undone. Projects save as JSON and reopen on any device.
Try every tool in the live demo.
Install: one Gradle line
The SDK is on Maven Central, which Android projects use already. Add it to your app module:
dependencies {
implementation("dev.nitrakit:nitrakit:0.2.0")
}Everything is in the dev.nitrakit package; the views are in dev.nitrakit.ui. The SDK asks for no permissions: media reaches it through your picker.
Show the Kotlin video editor in your Activity
The editor is two Android views. NitrakitPreviewView plays the project and lets the user move and resize layers; NitrakitTimelineView has the timeline, tools and panels. Give both the same Editor and they stay in sync with each other and with your code:
val preview = NitrakitPreviewView(this).apply { this.editor = editor }
val dock = NitrakitTimelineView(this).apply { this.editor = editor }
setContentView(LinearLayout(this).apply {
orientation = LinearLayout.VERTICAL
addView(preview, LinearLayout.LayoutParams(MATCH_PARENT, 0, 1f))
addView(dock, LinearLayout.LayoutParams(MATCH_PARENT, dp(400)))
})Create the views in code; they don't inflate from XML. They survive backgrounding on their own: the preview keeps its position and the editor keeps its state. When the screen goes away, set their editor to null and close the editor.
Your picker, your storage
The editor never opens the gallery or a file browser itself. When the user taps Add media, it asks your app through onRequest, a suspend function: show your picker, wait, return the result. Return null to use the SDK's built-in picker for fonts, colours, text, text styles and filters.
dock.onRequest = { request ->
when (request.kind) {
RequestType.ADD_MEDIA, RequestType.ADD_OVERLAY,
RequestType.ADD_AUDIO, RequestType.ADD_STICKER -> {
val file = pickMedia() // your picker, copied to a File
if (file == null) RequestResponse.Cancel
else RequestResponse.Source(editor.addMedia(file, id = startUpload(file)).source)
}
else -> null // built-in picker
}
}Projects refer to media only by your ids. Open a project on a device that doesn't have its files and the SDK asks where each id lives; return a URL, signed if you like, and it downloads it with progress on the clips:
NitrakitMedia.resolve = { id -> MediaLocation.Remote(api.signedUrl(id)) } // or Local(file)
More in Your pickers and Projects and media.
Export an MP4
editor.export renders an MP4 (H.264 video, AAC audio) to the path you give, in the background, while the user keeps editing. Progress and the result arrive on the export thread; job.cancel() stops it and leaves no file behind. Pick the project's size or scale the short side to 720 or 1080 px with exportSettingsFor. See Export.
Make it look like your app
Requirements
| Android | 8.0 or later (minSdk 26) |
|---|---|
| Language | Kotlin |
| Native libraries | arm64-v8a, armeabi-v7a, x86, x86_64 |
| Package | dev.nitrakit:nitrakit on Maven Central |
Minifying with R8? Keep the SDK's classes; its native code calls back into them by name:
-keep class dev.nitrakit.** { *; }Library, SDK or Media3?
Media3 Transformer is Google's library for editing video on Android: trimming, effects and export. It's the right tool if you need a fixed edit, such as trimming a clip before upload. What it doesn't include is the editor your users touch: a timeline, a preview that follows every change, text, undo, pickers and saved projects. That part is most of the work, and it's what Nitrakit gives you, ready to theme.
FAQ
- Which Android versions does it support?
- Android 8.0 or later (
minSdk26), onarm64-v8a,armeabi-v7a,x86andx86_64. - Does the SDK ask for permissions?
- No. Media reaches it through your picker, so your app decides what to ask for.
- Can I try it without a license key?
- Yes. Everything works without a key; exports are watermarked and up to 15 seconds. You need a key when you release. See pricing.
- How is the license key tied to my app?
NitrakitLicense.settakes aContextbecause the SDK checks your package name and signing certificate against the key. See License key.- How much does it add to my app?
- It's mostly one native library, and it doesn't grow with the features you use. Per-ABI numbers are in App size.
- Is it the same editor on iOS and React Native?
- Yes. The editor, preview, export, text and effects run on the same engine on every platform, so projects, features and exported videos are the same. See the iOS video editor SDK and the React Native video editor.