score:2
a media resource locator (mrl) is not the same as a url.
the log you posted shows what vlc is trying to open. the informative part is:
[1644d0ac] filesystem access error: cannot open file d:\desktop\file:\d:\desktop\app.jar!\media\video.mp4 (invalid argument)
"d:\desktop\file:\d:\desktop\app.jar!\media\video.mp4"
is clearly not a valid filename?
so this code is flawed:
string url = getclass().getresource("/media/video.mp4").getfile();
this type of thing, without the .getfile(), is usually used to load resources from the application classpath. that's not the case here though when you try and get the file name.
you should just do something like:
string mrl = new file("res/media/video.mp4").getabsolutepath();
but that of course depends on what is the "current" directory for your application, and won't work inside a jar file.
on the other hand, vlc can play media contained inside zip (and therefore jar) files, with an mrl that looks a little bit like what you posted. something like:
zip://file.jar!/res/media/video.mp4
Source: stackoverflow.com
Related Query
- VLCJ - playing a video from the "res" folder works great in eclipse, but not from the executable JAR file
- A WAR file created from Eclipse does not work from browser, but it works when the war file is expanded
- lombok in eclipse works in windows 7 when started from the command line, but not when started from the start button
- Create a new java package in eclipse (apart from default package), but can not use the class from external library in the files in this new folder
- error with tomcat HTTP Status 404 The requested resource() is not available from eclipse but works from browser
- "method is ambiguous for the type" but the types are NOT ambiguous (and the error comes by upgrade from eclipse 3.7.2 to eclipse 4.2)
- Unable to build: the file dx.jar was not loaded from the SDK folder in my eclipse
- Eclipse - cant add jar to build path. jar is inside the lib folder of project, but not visible
- eclipse/maven/sonatype war build works at the command line but not in eclipse
- Eclipse is not showing any projects from my workspace folder even the projects are there?
- Code works on command line, but not in eclipse (compiling a class from a string...)
- After importing from a git in eclipse I get the error "source folder is not java project"
- ant command works from within Eclipse but not from linux command line
- Jboss - mapping IP instead of localhost - works from within eclipse But not from run.bat without options
- mvn install is not working in eclipse but works fine from command line
- mvn clean install is not working from command line but works fine in eclipse
- Maven works from terminal, but not from Eclipse in Yosemite
- why eclipse not detect the jar file from lib folder
- Ant TestNG build works in Eclipse but not from terminal
- Can not add all the classes files from the JNI folder in Eclipse (JAVA, Windows 7)
- Eclipse with Websphere 7.0.0.17: EJB project does not work with resources within the workspace, but works with resources on Server
- Can anyone tell me why this works in eclipse but not in the command prompt?
- Running from Eclipse can not find tld-file, but running in jar it works
- Playing videos works fine in Eclipse but when exporting the java project as an runnable JAR file it doesnt work anymore
- Eclipse CDT cannot launch the binary it generated, but launch works from cmd
- Program works from Eclipse but not from executable JAR file
- Running the suite from jenkins is throwing error of Element not found but same build passes smoothly when run as TestNG suite from Eclipse IDE
- Why do my selenium tests run in Eclipse (TestNG Firefox), but not from the command line (ant)?
- How do I display a folder that exists in the file system, but not in Eclipse
- Spring Batch - the batch works in Eclipse but not as a JAR - without explicit DEBUG log
More Query from same tag
- How to delete commit history in gerrit in eclipse?
- ClassNotFoundException after exporting from working application in Eclipse
- Eclipse 404 Requested resource not available
- Aptana/Eclipse: How do I make a project that uses existing files on my filesystem, instead of copying?
- How to create a Runnable Jar File on Mac with Eclipse
- Android VM crashes on Launch Mac
- phpdoc @var in php file
- Eclipse RCP cheat sheet for extension points?
- Can't connect to MySQL in Java EE/JBoss application
- No command output when running: 'am start -n
- Retrieving all data from a Database Column
- How can I write a reference to one of two things?
- ManagedBeanCreationException: Unable to create managed bean richBean
- Ant script in Eclipse uses the incorrect version of Java
- Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS
- Deploying Google Calendar project gives INSTALL_FAILED_VERSION_DOWNGRADE
- how can i overcome this compilation error?
- Eclipse can't find file in bin directory
- Cannot connect to VM: socket operation on nonsocket - configureBlocking
- How do you debug a problem in the Activator of an Eclipse plug-in?
- How do I generate code under Eclipse+PyDev?
- Is there a way to nest packages in Eclipse's Package Explorer?
- Gwt-servlet.jar had error when import project from bitbucket
- Error when attempting to connect to local Database
- Remove all unused imports after moving type to new package?
- Eclipse MessageConsole seems blocked - need Asynchronous output
- Need some help on setting up spark for cassandra on java
- simplecaptcha-1.2.1.jar cannot be read or is not a valid ZIP file
- How to fix bad version in eclipse plugin?
- Display Application Size In Eclipse