Jump to content
  • Advertisement
Sign in to follow this  
Hick

start windows media-player by the console

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello collegues, as an intro for my little game, i want to play an (selfmaded :)))) ) video .avi. That mean's, when the player start the game by pressing s, the windows media-player opens and the startfilm is shown. Which is the console-command to play a film on windows media-player? Thank you verry for your help, hick

Share this post


Link to post
Share on other sites
Advertisement
I don't have Windows Media Player installed at the moment so I can't test the following but I think this is the command to launch Windows Media Player and a media file from the console/Run under Windows 98 at least:

mplayer C:\Sound.wav

If you're programming in C++ you could include cstdlib and call system("mplayer C:\Sound.wav") or Shell if it's VB you're using.

Also, you could consider using mciSendString (win32 function - include windows.h) which supports many types of media files and can automatically create a scalable window to play the media file in (if it's a movie):

//open the movie
mciSendString("OPEN movie.avi TYPE MPEGVIDEO ALIAS movie1", NULL, 0, NULL);
//play it from frame 0
mciSendString("PLAY movie1 FROM 0", NULL, 0, NULL);

//and when you're done close the movie:
mciSendString("STOP movie1", NULL, 0, NULL);
mciSendString("CLOSE movie1", NULL, 0, NULL);

As you see, the file name is used to open the file and create an alias, then the alias is used to play, stop and close the file.

MSDN:
win32 mcisendstring

Good luck!

\Jimmy H

Share this post


Link to post
Share on other sites
@ Jimy H,

thank your verry much for the help!!!

I will make a frame and start the film in the frame, but since I am only dealing with the console, I dont now, how I can make a freame.

@ all,

can perhaps someone show me, how I can make a frame at a specific position, with a specific length and width? Because I have a graphic card, with two monitors attached and I want to show the film only on the second monitor, but in full screen. But the second one is an old one with an resolution of 600x800:)))))

i think, when i make a frame, 600x800 with an initial position at the upper right position of the master-monitor, then I can show on the slave-screen a full-screen movie:)))))))))

what you think on this idea?

thank you verry much for reply,

hick

Share this post


Link to post
Share on other sites
You could also start the user's default AVI viewer by passing the filename to ShellOpen( ... ). This is the standard way and more friendly, since it does not rely on WMP to be present.

Greetz,

Illco

Share this post


Link to post
Share on other sites
@ Illco,

that mean's I can write on my cpp-program ShellOpen(filename.avi) and the standart-player will open and plays the .avi file?

How can I change the position of the standart-player-field?

When the standart-player is already open, can I then also play another film, that gives me the possibility for sequel-sequences on my little cpp-game ;)))))


thank you verry much for all your help

sincerly,

Hick

Share this post


Link to post
Share on other sites
You can, assuming that you are writing a Windows program (which seems most appropriate when using WMP). I thought it was ShellOpen, but otherwise it is something like that; look it up in the docs. As to how to go about actually interacting with the created instance of the player: I don't know.

Greetz,

Illco

Share this post


Link to post
Share on other sites
@ Illco,

Thank's a lot for the reply, but what you think about the idea to make a separate frame and to show the film in the frame?

Like I have told some postings befor, but for the moment, I dont know, how to make a frame:((( can you help me with a bit code?

thank you all,

Hick

Share this post


Link to post
Share on other sites
Hey. Can't one play video files through DirectX, or something like that. Alas, that maybe be what you were intented.

Share this post


Link to post
Share on other sites
I guess there's code for an AVI player in the NeHe tutorials. Lesson 35, if I'm not mistaken. It uses OpenGL, though.

Son Of Cain

Share this post


Link to post
Share on other sites
@ danne89 and Son of Chain,

Thank you verry much for all your help.

But when I read the post from Jimmy H, it seem's to bee quite easy to play a fiedeo in a frame, so I am just wondering, how I can make such a frame. I think it will bee a normal frame, isn't it?


thank's for code and help,

hick

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!