I've been trying to work with vlcj for last two hours but I cannot figure out how to get it to work. I've been using this tutorial. Even after writing my code like in the tutorial, I am still getting this error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[000000001a8ed480] core stream error: corrupt module: C:\VideoLAN\VLC\plugins\stream_filter\libdash_plugin.dll
[000000001a8d7a30] core demux meta error: corrupt module: C:\VideoLAN\VLC\plugins\meta_engine\libtaglib_plugin.dll
[000000001a8acfb0] core vout display error: Failed to set on top
Here is the code that I am using, it's a bit different than the tutorial because my program has different requirements.
public class AVPlayer extends JPanel{
private EmbeddedMediaPlayerComponent mediaPlayer;
private String vlcPath, mediapath ; //iniitalized in chooseFile()
//constructor
public AVPlayer() {
chooseFiles();
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcPath);
mediaPlayer = new EmbeddedMediaPlayerComponent();
add(mediaPlayer);
setSize(400,400);
}
// method to explicitly choose the VLC path and the video file I want to play
private void chooseFiles(){
JFileChooser ourFileSelector = new JFileChooser();
File ourfile;
//choose vlc path
ourFileSelector.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
ourFileSelector.showSaveDialog(null);
ourfile = ourFileSelector.getSelectedFile();
vlcPath = ourfile.getAbsolutePath();
//choose media path
ourFileSelector.setFileSelectionMode(JFileChooser.FILES_ONLY);
ourFileSelector.showSaveDialog(null);
ourfile = ourFileSelector.getSelectedFile();
mediapath = ourfile.getAbsolutePath();
}
//called in main to play the video
public void playVideo(){
mediaPlayer.getMediaPlayer().playMedia(mediapath);
}
}
And here is main
public static void main(String[] args) {
JFrame frame = new JFrame();
AVPlayer player = new AVPlayer();
frame.add(player);
frame.setVisible(true);
frame.validate();
player.playVideo();
}
There are three different things here.
The first is simply a warning about configuration of the SLF4J logging API that vlcj now uses. That is simple to "fix" by following the link you posted.
The second on corrupt modules is a native error being reported by VLC itself. The most that can be said here is that VLC failed to load and initialise those plugins (libdash and libtaglib), but as to precisely why it failed it is very difficult to say. If you're using a 64-bit VLC on Windows, try a 32-bit VLC and a 32-bit JVM instead.
The third is the "Failed to set on top..." - this is also a native warning reported by VLC and in my experience can be ignored with no detrimental effect.
There is nothing really in vlcj here that is implicated in any of these issues.