Vlc Player For Java Mobile Download

VLC is a famous open-source video player, which runs on multiple platforms and plays various types of audio/video format.

The vlcj project provides a Java framework to allow an instance of a native VLC media player to be embedded in a Java application. You get more than just simple bindings, you also get a higher level framework that hides a lot of the complexities of working with LibVLC. VLC 2.0 for Android out now. The VLC media player might well be one of the most efficient and versatile options now available. Its Android version had always trailed the desktop software by a little ways, but that seems to no longer be the case with this new version 2.0 for smartphones. VLC-Lite media player. 3.9 on 109 votes. VLC-Lite is a stripped-down, compact version of the VLC. The vlcj project provides a Java framework to allow an instance of a native VLC media player to be embedded in a Java application. You get more than just simple bindings, you also get a higher level framework that hides a lot of the complexities of working with LibVLC.

Vlc Player For Java Mobile Download
  • Official site;

For this article, we will use version 2.2.1, which can be downloaded from: http://download.videolan.org/pub/videolan/vlc/2.2.1/. Download it and unzip the folder in an easy to find directory, like D or C disks root.

Note: The operating system will be Windows 8.1 - 64 bits.

At the site http://code.google.com/p/vlcj/, we can find the VLCj API, which lets you interact with the player VLC, accessing almost all of its features. The version used is 3.8.0, which can be downloaded from the following link: https://github.com/caprica/vlcj/archive/master.zip.

Note: The source code of this article also works on Windows 32-bit. However, you must download the 32-bit Oracle JDK (even if your system is 64-bit), and install the Win32 version of VLC (link above) for the examples to work correctly.

Setting dependencies

We'll also use Eclipse IDE as the tool to develop the example shown here in the article. Make sure to download a version compatible with JEE features, including Maven plugin. So, create a new Maven project and, at the first window opened, check the option 'Create a simple project (skip archetype selection)' and click Next. Then fill the fields as shown in Figure 1.

Figure 1. Configuring maven project settings.

As dependencies, you'll need to have a JDK 1.6 or 1.7 configured in your machine. All the other dependencies of the VLC API will be loaded by Maven itself. So, open pom.xml file and update it with the code shown in Listing 1.

Listing 1. XML of needed dependencies for the example.

After this, if you access your Java Build Path (via project menu Properties > Java Build Path > Libraries) you must see the same as in Figure 2.

Figure 2. Libs added to the Java Classpath.

Note: JNA is an API that allows you to access native code from Java.

Testing LibVlc

Let's create a new class called InformationLib and put the code present in Listing 2 on it.

Listing 2. Test class to check vcl information.

In Listing 2 you can see the output.

Listing 2. Output of previous code.

LibVlc is an interface that represents some of the native features of VLC (exposed by libvlc.dll and libvlc.so on Windows and Linux, respectively). This interface has an INSTANCE attribute, which is a concrete implementation of LibVlc interface, allowing access to all the methods defined therein. Javadoc with the listing of all available methods of this interface, as well as the rest of the API, can be downloaded from the following link: https://github.com/caprica/vlcj.

Creating the audio/video player

Let's start by the class MinimalPlayerTest, which will save all the main code of the implementation. Create it and add code in Listing 3 to it.

Listing 3. Code of main class - MinimalTestPlayer

The listing is fully commented, so you can understand it better by reading the code. Please, make sure to place a video called 'video.mp4' into the video folder at D disk, or change the path into main method. Do the same with VLC unzipped folder in method configureParameters. Otherwise, the example won't work. Run the class and you'll see the same result as in Figure 3.

Figure 3. Test Player executing.

Conclusion

Download Vlc Player For Desktop

Although the examples were run on Windows, the same is valid for Linux (runs very well too). Now, you can create your own audio/video player, customize it and even control it via internet, mobile, etc.

I hope this article assists developers to explore this interesting API.

Vlc Player For Java Mobile Free Download

Thank you and see you soon!