How to embed VLC media player to my Android App

前端 未结 7 1963
萌比男神i
萌比男神i 2020-12-01 01:02

Is there a way to embed VLC media player to Android Application? I have several issues:

1) I have a video streaming Camera (from RTSP) and I cannot play its stream o

相关标签:
7条回答
  • 2020-12-01 01:16

    The libVLC is provided by the official VideoLAN project hosted on BinTray. You can directly use the library as a dependency without having to compile it.

    add maven url "https://dl.bintray.com/videolan/Android" to your project-level Gradle file as shown below:

    allprojects {
     repositories {
          google()
          jcenter()
          maven {
            url "https://maven.google.com";
            }
          maven { url "https://dl.bintray.com/videolan/Android" }
      }
    }
    

    and in your app-level Gradle file, add the libVLC dependency

    implementation 'org.videolan.android:libvlc-all:<latest-version-here>'
    

    Get the latest libVLC version from the below official VLC GitHub repository.

    find the string "libvlcVersion" to get the latest version.

    https://github.com/videolan/vlc-android/blob/master/build.gradle#L33

    0 讨论(0)
  • 2020-12-01 01:17

    Some other answers link to outdated versions, however actual for 2019.03 is LibVlc for all platforms 3.1.8. This is .aar version, you may add it to your project with these instructions and use.

    However if all-version is too large(over 70MB), here is armv7 version, and here if x86.

    0 讨论(0)
  • 2020-12-01 01:19

    Maruku has given a great answer.

    In addition, if you don't want to compile libVLC on your own machine, mrmaffen has kindly thrown it up onto maven central. So in your .gradle file include

    compile "de.mrmaffen:vlc-android-sdk:1.9.8"
    

    Keep in mind that LibVLC may not be 100% updated because you aren't compiling the source yourself.

    More info can be found here on GitHub

    0 讨论(0)
  • 2020-12-01 01:20

    Step 1 : install Linux

    Step 2 : install ndk and sdk

    Step 3 : change your directory path upto compile.sh

    then compile.sh run through your Linux terminal and generate apk

    Compile - Run - Enjoy

    0 讨论(0)
  • 2020-12-01 01:28

    2019 sees introduction of a VLCVideoLayout component that greatly simplifies the code required to embed VLC into android.

    https://code.videolan.org/videolan/libvlc-android-samples

    The libVLC is provided by the official VideoLAN project hosted on BinTray. See the build.gradle files for the link to the Maven repo and the package name/version.

    https://code.videolan.org/videolan/libvlc-android-samples/blob/master/build.gradle#L18 https://code.videolan.org/videolan/libvlc-android-samples/blob/master/java_sample/build.gradle#L34

    0 讨论(0)
  • 2020-12-01 01:32

    Yes, if you already have the vlc-sdk.7z (libVLC for android), here is the sample project to embedded VLC into your android apps.

    If you do not have libVLC, here are the steps to build one. (After "sh compile.sh" finished, "make vlc-sdk.7z" to create the vlc-sdk.7z and unzip to the demo project.

    I put the vlc-sdk.7z(only armeabi-v7a is included) here for testing.

    0 讨论(0)
提交回复
热议问题