• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent -- How to open video or audio player through a GUI ?

 
s srikanth
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Is there anyway to open media player or sound player (real player or win amp ) through a java program ?
i have no idea about the corresponding API's . Can u tell me how this is possible thr a java program .
java program means .. i can say like ... suppose i have one GUI in swing .. if i press one button then the
real player or media player should be opened as a part of GUI Frame ( say some JFrame ) and the corresponding
video or audio file should be executed from there ..is it possibe ?
if anyone have idea then plz help me out ..
Code samples are also welcome .
Thanx in advance ,
Srikanth S
 
Shane Roylance
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may not help you at all, but you can execute an exterior program with code such as this:
Runtime r = Runtime.getRuntime();
try{
Process p = r.exec("<program path>");
} catch (Exception e){
}
I don't know how to get it to run in a JFrame, and I am not sure about the API for these applications. It seems to me that you can pass an mp3 file on the command line for winamp.
 
Michael Szul
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the Java Media Framework at http://java.sun.com/products/java-media/jmf/index.html
I don't thing it'll launch WinAmp or RealPlayer though. I think this is for creating your own solutions.
To launch other programs like that, I recommend following the example of the post before this one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic