| Author |
JMF can't play media file in a jar file
|
Caven Wang
Ranch Hand
Joined: Jul 07, 2001
Posts: 31
|
|
I am using JMF to play a sound file(ot.au). My applet works in and out of my JBuilder. When I put all stuff into a jar file, it reports: javax.media.NoPlayerException: Cannot find a Player for :jar:file:/H:/player.jar!/data/ot.au my code: ... try {url=this.getClass().getResource(mediaFile) ; } catch (Exception mue) { mue.printStackTrace() ; } ... try {player=Manager.createPlayer( url); } catch (NoPlayerException e) { System.out.println(e); }
|
@_@ Life is so nice!
|
 |
Peter Gragert
Ranch Hand
Joined: Jan 16, 2001
Posts: 421
|
|
I lately needed *.gif files (pictures for JLabels). I put it in a jar file too: does not work either. Solution was: not in the jar but at a (relative) dir where the jar file lives! .../your.jar .../audio/*.* and then read from audio e.g. Peter
|
 |
Caven Wang
Ranch Hand
Joined: Jul 07, 2001
Posts: 31
|
|
Hi, Peter When resource files, such as media or images, are included in a jar file, the applet can run faster. At least the applet can save time to download its multimedia resource. I make it while loading an image from a jar file. Sound is also OK. The big problem is that JMF cann't make it!
|
 |
 |
|
|
subject: JMF can't play media file in a jar file
|
|
|