Hello guys , am new to Android Development, I've created many test apps for learning, using webview and lists and creating multiple activities,
I have an application that get URL with JSON data contain url with streaming video and when click on button open VLC with URL provided.
JSon FILE

[{"ch":"http://www.examplevideo.com/video.mp4"},{"ch":"http://www.examplevideo.com/video2.mp4"}]

Recommended Answers

All 8 Replies

There is no official API yet as this is still under development. However according to VLC forum you just need to do this

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse("http://example.com/media/test.mp4"), "application/mp4");
startActivity(intent);

My suggestion would be to check first for vlc in PackageManager to avoid crash if app not installed. You can follow discussion on intent here

Thanks @PETER BUDO , my first problem is I can't add VLC lib to my project because I need to compile it first using linux which I don't have :(, is there any .jar file so I cant import it easily?.

You are misunderstanding concept. This is not jar library that you add to your project, but rather expectation that user has this application installed on device and thereore with help of Android intent you can say "load this url with following application of this package name"

commented: thanks +2

@peter_budo I'll try this when I get to home :P, thanks.

thanks buddy works like a charm after added check for if VLC installed .
problem solved.

Glad to hear that!

peter budo thanks alot, it worked for me as well

@Hanif1993 you welcome

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.