如何将VLC媒体播放器嵌入我的Android应用程序

时间:2022-07-17 18:57:04

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

有没有办法将VLC媒体播放器嵌入Android应用程序?我有几个问题:

1) I have a video streaming Camera (from RTSP) and I cannot play its stream on my regular videoview panel (Sorry this video cannot be played error). However, I installed the VLC application for Android (beta version) and I was able to play it. 2) My main objective is to port a desktop java application which uses VLC plugin to Android. I want to accomplish this task with minimum effort (I have some time issues).

1)我有一个视频流相机(来自RTSP),我不能在我的常规视频视图面板上播放它(抱歉,这个视频无法播放错误)。但是,我安装了Android的VLC应用程序(测试版),我能够播放它。 2)我的主要目标是移植使用VLC插件到Android的桌面java应用程序。我想用最少的努力完成这项任务(我有一些时间问题)。

Another alternative, is there a way to embed codecs used by VLC to my application? Because with my videoview, the result varies according to the format of the video. I can play some other videos streamed through RTSP on my videoview.

另一种方法是,有没有办法将VLC使用的编解码器嵌入到我的应用程序中?因为使用我的视频,结果会根据视频的格式而有所不同。我可以在我的视频视频中播放通过RTSP流式播放的其他视频。

I search through internet and found a "libvlc" but also some notes about that libvlc for android is not complete (but those notes belong to a past time, even in *).

我通过互联网搜索并发现了一个“libvlc”,但也有一些关于android的libvlc的说明并不完整(但那些笔记属于过去的时间,即使在*中也是如此)。

3 个解决方案

#1


22  

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

是的,如果你已经有了vlc-sdk.7z(用于android的libVLC),这里是嵌入式VLC到你的Android应用程序的示例项目。

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.

如果您没有libVLC,请按以下步骤构建一个。 (在“sh compile.sh”完成后,“make vlc-sdk.7z”创建vlc-sdk.7z并解压缩到演示项目。

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

我把vlc-sdk.7z(仅包括armeabi-v7a)放在这里进行测试。

#2


18  

Maruku has given a great answer.

Maruku给出了一个很好的答案。

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

另外,如果你不想在你自己的机器上编译libVLC,那么mrmaffen就会把它推到maven central上。所以在.gradle文件中包括

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.

请记住,LibVLC可能不会100%更新,因为您没有自己编译源代码。

More info can be found here on GitHub

更多信息可以在GitHub上找到

#3


0  

Step 1 : install Linux

第1步:安装Linux

Step 2 : install ndk and sdk

第2步:安装ndk和sdk

Step 3 : change your directory path upto compile.sh

第3步:将目录路径更改为compile.sh

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

然后compile.sh通过你的Linux终端运行并生成apk

Compile - Run - Enjoy

编译 - 运行 - 享受

#1


22  

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

是的,如果你已经有了vlc-sdk.7z(用于android的libVLC),这里是嵌入式VLC到你的Android应用程序的示例项目。

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.

如果您没有libVLC,请按以下步骤构建一个。 (在“sh compile.sh”完成后,“make vlc-sdk.7z”创建vlc-sdk.7z并解压缩到演示项目。

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

我把vlc-sdk.7z(仅包括armeabi-v7a)放在这里进行测试。

#2


18  

Maruku has given a great answer.

Maruku给出了一个很好的答案。

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

另外,如果你不想在你自己的机器上编译libVLC,那么mrmaffen就会把它推到maven central上。所以在.gradle文件中包括

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.

请记住,LibVLC可能不会100%更新,因为您没有自己编译源代码。

More info can be found here on GitHub

更多信息可以在GitHub上找到

#3


0  

Step 1 : install Linux

第1步:安装Linux

Step 2 : install ndk and sdk

第2步:安装ndk和sdk

Step 3 : change your directory path upto compile.sh

第3步:将目录路径更改为compile.sh

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

然后compile.sh通过你的Linux终端运行并生成apk

Compile - Run - Enjoy

编译 - 运行 - 享受