Kmp External Codec Libvlcjni.so Cpu Arm64-v8a _hot_ Direct
# Clone VLC Android source git clone https://code.videolan.org/videolan/vlc-android.git cd vlc-android ./compile.sh -a arm64-v8a Output located at: vlc-android/libvlc/jni/libs/arm64-v8a/libvlcjni.so
android defaultConfig ndk abiFilters += "arm64-v8a" sourceSets getByName("main") jniLibs.srcDirs("src/androidMain/jniLibs") kmp external codec libvlcjni.so cpu arm64-v8a
src/ └── androidMain/ └── jniLibs/ └── arm64-v8a/ ├── libvlcjni.so ├── libvlc.so └── (other dependent .so files) In your build.gradle.kts (Android target): # Clone VLC Android source git clone https://code
For KMP, ensure the Android target uses androidTarget() and not android() . The jniLibs folder must be correctly merged during the final APK/AAB build. 4. Loading the Library in KMP Shared Code Use platform-specific expects/actuals to load libvlcjni.so : 4.1 Common Kotlin ( commonMain ) expect fun loadVlcLibraries() 4.2 Android Actual ( androidMain ) import android.os.Build import java.io.File actual fun loadVlcLibraries() System.loadLibrary("vlcjni") // Additional setup for VLC context Loading the Library in KMP Shared Code Use
Once loaded, you can instantiate VLC's MediaPlayer :