Code Monkey home page Code Monkey logo

libvlc-android-sdk's Introduction

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

libvlc-android-sdk's People

Contributors

masterwok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libvlc-android-sdk's Issues

Seek video

Hi I want to seek my video, can you please how to do this ? I had use mMediaplyer.settime() function but it could not jump 4 hours later.

Select Subtitle/Audio Track

Hi,
great fork. I just need to get work select audio/subtitle stream track. But if i use

mMediaPlayer.getSpuTracks() is null or mMediaPlayer.getAudioTracksCount() is "-1" i got every time "null". Do you know why its null ?

Can you help me with this ?

偶然出现播放卡8-10秒的问题

大佬,您好,反反复复退出,又进行播放,进来后视频播放会卡8-10秒,然后才能恢复流畅预览?是什么原因呢?它不是每次都会卡8-10秒,是偶然出现的,出现概率也挺大。不知道是什么原因呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.