i have an .MP4 video placed in the "res/media" folder inside my project. I can easily play this video in my application from eclipse using this piece of code:
String url = getClass().getResource("/media/video.mp4").getFile();
url = new File(url).getPath();
showMedia(url); //the method that plays the video
i had to use this code because using only URL url = getClass().getResource("/media/video.mp4");
makes VLCJ can't access the video using this URL.
When creating the executable JAR file, i get these errors in the console:
libdvdnav: Using dvdnav version 5.0.0
libdvdread: Could not open D:\Desktop\file:\D:\Desktop\app.jar!\media\video.mp4 with libdvdcss.
libdvdread: Can't open D:\Desktop\file:\D:\Desktop\app.jar!\media\video.mp4 for reading
libdvdnav: vm: failed to open/read the DVD
[1644d0ac] filesystem access error: cannot open file D:\Desktop\file:\D:\Desktop\app.jar!\media\video.mp4 (Invalid argument)
[1644d0ac] main access error: File reading failed
[1644d0ac] main access error: VLC could not open the file "D:\Desktop\file:\D:\Desktop\app.jar!\media\video.mp4" (Invalid argument).
[1645643c] main input error: open of `file:///D:/Desktop/file%3A/D%3A/Desktop/app.jar%21/media/video.mp4' failed
[1645643c] main input error: Your input can't be opened
[1645643c] main input error: VLC is unable to open the MRL 'file:///D:/Desktop/file%3A/D%3A/Desktop/app.jar%21/media/video.mp4'. Check the log for details.
The libraries are being successfully loaded, and i can even play any video that is outside my JAR file.
Any suggestions?
And thanks in advance.