All Projects → masterwok → libvlc-android-sdk

masterwok / libvlc-android-sdk

Licence: LGPL-2.1 license
An unofficial library of LibVLC for Android. The goal of this project is to be able to use LibVLC as an Android dependency.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to libvlc-android-sdk

MirakTest
Mirakurun 用映像視聴アプリ実装研究資料
Stars: ✭ 51 (+37.84%)
Mutual labels:  libvlc
dart vlc
🎞 Flutter audio / video playback, broadcast & recording library for Windows & Linux.
Stars: ✭ 439 (+1086.49%)
Mutual labels:  libvlc
libvlc-nuget
NuGet packaging setup for LibVLC
Stars: ✭ 52 (+40.54%)
Mutual labels:  libvlc
libvlcpp
C++ bindings for libVLC
Stars: ✭ 64 (+72.97%)
Mutual labels:  libvlc
awesome-vlc
👻 A curated list of awesome VLC and LibVLC resources.
Stars: ✭ 45 (+21.62%)
Mutual labels:  libvlc

Release

[UNOFFICIAL] libvlc-android-sdk

An unofficial library of LibVLC for Android. The goal of this project is to be able to use LibVLC as an Android dependency.

Usage

Add this in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and add the following in the dependent module:

dependencies {
    implementation 'com.github.masterwok:libvlc-android-sdk:3.0.13'
}

unless you're a fan of large APKs, you'll probably want to add the following to the build.gradle of your app so an APK is generated per ABI:

android {
    ...
    splits {
        abi {
            enable true
            reset()
            include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
            universalApk false
        }
    }
}

// Map for the version code that gives each ABI a value.
ext.abiCodes = [
        'armeabi-v7a': 1,
        'arm64-v8a'  : 2,
        'x86'        : 3,
        'x86_64'     : 4
]

import com.android.build.OutputFile

android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))

        if (baseAbiVersionCode != null) {
            output.versionCodeOverride = baseAbiVersionCode * 10000000 + variant.versionCode
        }
    }
}

Building (LibVLC)

This is the tricky bit. If you want to build this project on your own, I would recommend doing it within a Ubuntu VM. I ran into quite a few build problems and found it helpful to fallback to snapshots when initially attempting to build LibVLC. Follow the official compile wiki here to setup your development environment (no need to clone repo or that jazz yet, see below). Once completed, follow these steps:

  1. Clone this repository.
  2. Open the repository in Android Studio.
  3. Delete the jniLib folders for all architectures within the libvlc module of this project.
  4. Delete the org.videolan.libvlc directory under the libvlc module of this project.
  5. Delete the vlc-android directory should it exist in the root of the project.
  6. Run, './buildlibvlc.sh -a ARCH' where ARCH is the architecture you wish to build for (i.e. x86, x86_64, armeabi-v7a, arm64-v8a)
  7. If the build was successful, celebrate and continue onto the next step. Else, slam face into keyboard, tweak your development environment, maybe grab a beer, and go back to step 5.
  8. Unzip the AAR file at, "vlc-android-libvlc/build/outputs/aar"
  9. Copy the folder of the architecture you just compiled from within the jni folder (i.e. armeabi-v7a) of the extracted AAR to the jniLib folder within the libvlc module.
  10. Repeat from step 5 until all architectures are built.
  11. Copy "vlc-android/libvlc/src/org" to the java folder of the libvlc module of this project.
  12. Build and run the sample project. SUCCESS!

Licensing

See VLC FAQ

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].