• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JMF can't play media file in a jar file

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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); }
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic