Android, how to play video using VLC Player?

I have an application to play videos in Android, like

https://play.google.com/store/apps/details?id=com.vlcforandroid.vlcdirectprofree&hl=en

I want to integrate this application into my application. I have Url for Streaming video and I want to open this video in this application (Vlc Direct), Any idea?

I open this application using:

Intent i = new Intent(Intent.ACTION_MAIN);
            PackageManager manager = getPackageManager();
            i = manager.getLaunchIntentForPackage("com.vlcdirect.vlcdirect");
            i.addCategory(Intent.CATEGORY_LAUNCHER);
            startActivity(i);

But how does it start with video streaming or any other player for video streaming?

+6
source share
4 answers

Moreover,

Intent i = new Intent(Intent.ACTION_MAIN);
i.setComponent(new ComponentName("com.vlcdirect.vlcdirect", "com.vlcdirect.vlcdirect.URLStreamerActivity"));
i.putExtra("url", url);
startActivity(i);

, , , , - . vlcdirect ,

  • ,

  • URL- , ; dedex .apk, ; , ; , , .

" URL", vlcdirect , , vlcdirect .

+3

VLC :

Intent i = new Intent(Intent.ACTION_VIEW);
i.setPackage("org.videolan.vlc.betav7neon");
i.setDataAndType(Uri.parse("http://ip:8080"), "video/h264");
startActivity(i);

. "/*"

+3

Previous answers did not work. After a little search, I found the white papers here .

Basically here it is:

int vlcRequestCode = 42; //request code used when finished playing, not necessary if you only use startActivity(vlcIntent)
 Uri uri = Uri.parse("file:///storage/emulated/0/Movies/KUNG FURY Official Movie.mp4"); //your file URI
 Intent vlcIntent = new Intent(Intent.ACTION_VIEW);
 vlcIntent.setPackage("org.videolan.vlc");
 vlcIntent.setDataAndTypeAndNormalize(uri, "video/*");
 vlcIntent.putExtra("title", "Kung Fury");
 vlcIntent.putExtra("from_start", false);
 vlcIntent.putExtra("subtitles_location", "/sdcard/Movies/Fifty-Fifty.srt"); //subtitles file
 startActivityForResult(vlcIntent, vlcRequestCode);

You can remove unnecessary parts for you.

0
source

I use this ..

private void stream(String url, String title){
    int vlcRequestCode = 42;
    Uri uri = Uri.parse(url);
    Intent vlcIntent = new Intent(Intent.ACTION_VIEW);
    vlcIntent.setPackage("org.videolan.vlc");
    vlcIntent.setDataAndTypeAndNormalize(uri, "video/*");
    vlcIntent.putExtra("title", title);
    vlcIntent.putExtra("from_start", true);
    //vlcIntent.putExtra("position", 90000l);
    //vlcIntent.putExtra("subtitles_location", "/sdcard/Movies/Fifty-Fifty.srt");
    startActivityForResult(vlcIntent, vlcRequestCode);
}
0
source

All Articles