This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Window Media Player Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Window Media Player" Watch "Window Media Player" New topic
Author

Window Media Player

Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
Hi All,

I want to execute window media player from one java program.. and i want to run specific file in media player.. what is the method to call media player and how to pass parameter to media player..

does any one knows ??

Regards
Amit


Amit
University of Florida
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18500
    
  40

The Windows Media Player is simply an exe program named "wmplayer.exe". Where it is located will depend on where it is installed, but it is likely in "c:>Program Files\Windows Media Player\". Or you could just have it in your path.

As for the parameters on how to run it, you can take a look at the command line docs at Microsoft:

http://msdn2.microsoft.com/en-us/library/bb262178(VS.85).aspx

Once you figure out the exact command that you want, you can add that command to your Java program via the Runtime class.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
Great!!!

is there any way to stream file in media player using java.

is there any way to save file which is in buffer of media player using java
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
Also what if i want to run one file which is on remote machine..

what is the method to authenticate the network..??
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
i can access the file of remote machine using..

Runtime class..
and then using exec "wmplayer /play \\9.182.241.178\temp\too_cute1.mpg"


but for that i need to have a network session setup with that machine..

how to do that..??
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
I am working on a similar problem in my development project and have not had any time to work on this but I would like to suggest staying within java for your effort because of cross-platform issues. See: The Java Sound API specification and The Java Media Framework API

There is a hang in many video-grapic calls using popular formats and I just totally miss out on all the latest news such as Britney Spears is an Object Oriented Programmer... because of poorly written code, preferring instead to use Java as opposed to another language where performance counts. It seems as though all the FlashTrash cannot follow the lead of the Minneapolis Musician in the 80's who fell-swooped the Jayhawk's.

(old jokes, probably a year old - don't try to make sense of it)

Becuase of this have scripting in the browser totally defeated and would enjoy working with you on this in the computing in general forum or other forum such as the moderators may direct.


"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
Hi Henry,

is there any way to pass the user name and password of the remote machine in my url..??

like

wmplayer /play http:\\hostname\filename

is there any way to embed user name and password in above command.??
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18500
    
  40

is there any way to pass the user name and password of the remote machine in my url..??

like

wmplayer /play http:\\hostname\filename

is there any way to embed user name and password in above command.??


Does such a feature exists? I would be interested to know too.

The last time that I needed to get around being challenged for the password while accessing a networked file (in Samba), was to configure the network folder to be a public share. This would remove all security on the shared folder, but I was just using it to quickly transfer non-important files. (and in the intranet)

Henry
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Originally posted by Henry Wong:


Does such a feature exists? I would be interested to know too.

The last time that I needed to get around being challenged for the password while accessing a networked file (in Samba), was to configure the network folder to be a public share. This would remove all security on the shared folder, but I was just using it to quickly transfer non-important files. (and in the intranet)

Henry


Can we transfer this to Security: SSL, LDAP, JCE, JAAS, etc, there are greymeat isssues involved and Pat Farrell seems to be the only one who knows these issues effectively, it is discussed in his thesis: can be modelled as a collection of abstract single-user single-task machines connected at their user interfaces

The user interface is a remarkably slippery mind-field where ideas reign millions of Joe Average to harness a system where most cannot even deal with the idea of a folder, let alone the mapping of a backslash to some disk-head position ( and associated L-2 writebacks ) - all of which represents easily harnessed attack portals.

I was reading a web-page a month ago of a legitimate worker in the field of computer security, a poll was being run as to what is the biggest security problem, an open poll and we do not know who really was replying.

1,500 - the keyboard and associated ( mind )
850 - all other categories combined

For my part, I will only work this further if it shows up in the security forum at javaranch, be though it may I find this subject overly tempting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Window Media Player
 
Similar Threads
How to download songs from server?
call javafx in jsp
how to get default media player name of the OS?
Window Media Player In Java
call javafx in jsp