File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Running media player from the program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Running media player from the program" Watch "Running media player from the program" New topic
Author

Running media player from the program

faisal siraj
Greenhorn

Joined: Oct 03, 2005
Posts: 9
Hello.i just want to run a mediaplayer from my program.How can i do this in java.IN C/C++ we have System command that fullfills the purpose.How can i perform the same function from java
amod gole
Ranch Hand

Joined: Dec 07, 2005
Posts: 81
hi faisal siraj ,

you can run media player by two ways
1 using processbuilder object this works only with java1.5

PrcocessBuilder pb=new ProcessBuilder("spceify path of wmplayer");
now call (i am not explaining other features of processbuilder like how to set directory and how to set environment variable because i also dont know and no one from java ranch explain me!!! )
pb.start();
it will start media palyer

start method returns process object using this object you can controll that process like closing ,destroying etc.

for java1.4

use runtime class
code
Runtime r=Runtime.getRuntime();
now usig this runtime object call exe method
r.exec("specify path of wmpalyer");

ok by....







 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running media player from the program
 
Similar Threads
Glassfish connecting to MS SQL server error
SCJP Query
C++ Client- EJB Server
How find out how many dimensions an objectArray has?
Java and C++