Hello everybody. I have installed JMF in my Windows 7 and working with it there along with Swing. For testing purpose I executed the executable jar file from Windows XP and there JMF is not installed and I am getting errors and can not able to play mp3 from XP. What should I do now? Any suggestion will be very helpful to me.
Thank you.
How to use JMF ?
Page 1 of 15 Replies - 4071 Views - Last Post: 14 August 2010 - 10:45 AM
Replies To: How to use JMF ?
#2
Re: How to use JMF ?
Posted 14 August 2010 - 09:57 AM
Why don't you also install JMF on your XP ?
#3
Re: How to use JMF ?
Posted 14 August 2010 - 10:08 AM
Thank you for giving reply sir.
It is a part of my project. So I shall might have to show/execute it in a computer where I can not install JMF.
I am also using some extra jar library, like AbsoluteLayout, Nimrod Look and feel. I put these in my resources sub-folder of src and I test my work in XP, where I installed only JRE (As I think in college's computer have JRE installed only). I transfer only executable jar file along with lib directory of dist folder to XP for testing. Hope you understand sir what I am talking about. Sir how can I do this.
Thank you.
It is a part of my project. So I shall might have to show/execute it in a computer where I can not install JMF.
I am also using some extra jar library, like AbsoluteLayout, Nimrod Look and feel. I put these in my resources sub-folder of src and I test my work in XP, where I installed only JRE (As I think in college's computer have JRE installed only). I transfer only executable jar file along with lib directory of dist folder to XP for testing. Hope you understand sir what I am talking about. Sir how can I do this.
Thank you.
#4
Re: How to use JMF ?
Posted 14 August 2010 - 10:10 AM
So add the JMF.jar into your own .jar.
P.S.
You will have to decompress it before re-inserting it into your .jar.
P.S.
You will have to decompress it before re-inserting it into your .jar.
#5
Re: How to use JMF ?
Posted 14 August 2010 - 10:21 AM
Thank you sir.
JMF .jar means C:\Program Files\JMF2.1.1e\lib\jmf.jar?
Sir will I add this in that way like Nimrod?
JMF .jar means C:\Program Files\JMF2.1.1e\lib\jmf.jar?
Sir will I add this in that way like Nimrod?
#6
Re: How to use JMF ?
Posted 14 August 2010 - 10:45 AM
Thank you sir. It is working. I did it as you instructed me. And I am not getting "class not found error" in cmd of XP. But also not able to here any sound. I put my mp3 file in resources folder of src. In /dist/lib, there is no .mp3 file but all other .jar libraries are there. In my program I used file reference as :
And the MP3 class is :
Sir how to specify the location of the file during execution. Should I pass the path as command line parameter(s)? But what about the case of executing it by clicking the executable jar file?
MP3 mp3 = new MP3("file:///C://Users//Tanmoy//Documents//NetBeansProjects//Super Scientific Calculator//src//resources//what_the_hell.mp3");
And the MP3 class is :
package mp3player;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.*;
/**
*
* @author Tanmoy
* @Super Scientific Calculator
* @version 1.2010
*
*/
public class MP3 extends Thread {
private URL url;
private MediaLocator mediaLocator;
private Player playMP3;
public MP3(String mp3) {
try {
this.url = new URL(mp3);
} catch (MalformedURLException ex) {
Logger.getLogger(MP3.class.getName()).log(Level.SEVERE, null, ex);
}
if (url == null) {
System.out.println("1");
}
}
public void run() {
try {
mediaLocator = new MediaLocator(url);
playMP3 = Manager.createPlayer(mediaLocator);
} catch (java.io.IOException e) {
System.out.println(e.getMessage());
} catch (javax.media.NoPlayerException e) {
System.out.println(e.getMessage());
}
playMP3.addControllerListener(new ControllerListener() {
public void controllerUpdate(ControllerEvent e) {
if (e instanceof EndOfMediaEvent) {
playMP3.stop();
playMP3.close();
}
}
});
playMP3.realize();
playMP3.start();
}
}
Sir how to specify the location of the file during execution. Should I pass the path as command line parameter(s)? But what about the case of executing it by clicking the executable jar file?
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|