Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing a video

Status
Not open for further replies.

lvfrenchflair

Technical User
Aug 12, 2004
6
FR
Hi,

I'm trying to add a video to my program so that when I click on a particular button on a toolbar or on a menu item etc. it shows a video. I've used the Open command before, but this seems to only open files to enable things to be added or changed or read, it doesn't actually show the file running.

Any ideas how I can get my video to play?

Thank you!
 
It depends on how deep you want to go in VB regarding multimedia. You can use DirectX or, if you wanna do the job in the simple way, use MS multimedia control that comes vith VB.

Hope I've been helpful,
Bogdan Muresan.
 
Hi there
If you only want to display an avi file, then just add comct232.ocx to your project and then use filename.open

Hope this helps
John
 
Thanks, have tried using the comct232.ocx (microsoft windows common controls 2) and typing in the filename followed by .open but this hasn't worked at all. typing in the filepath then .open won't even let me leave the line (it all appears in red), and saving it as a variable name then typing .open gives me an error saying that my variable is an invalid quantifier.

I've also tried putting the Windows media player control on the form but can't figure out how to use it from there. is there code that i'm meant to use to tell it to play the video?

thank you!
 
Private Sub Command5_Click()
MMControl1.DeviceType = "AviVideo"
MMControl1.FileName = "C:\WINDOWS\Desktop\DevTheBird.avi"
MMControl1.Command = "Open"
MMControl1.From = 0
MMControl1.Command = "Play"
End Sub

Follow this exam and let me know if it helps
glenn
 
What's the MMControl1 referring to? The code doesn't work with either the windows media player control (called WindowsMediaPlayer1) or with anything from the comct232.ocx.
 
I told you to use MS multimedia control (that's MCI32.OCX), NOT Windows Media Player (that's msdxm.ocx).

So use the control I've told you and the code of INeedSomeSeriousHelp will work. Sorry about not telling you the necessary code, but I supposed you will find it in MSDN. Believe me, it is there!

Trie it and tell us if it works now!

Hope I've been helpful,
Bogdan Muresan.
 
BTW, do you want to show the video in your application (in one of your forms) or you want to lounch the default application in the system to play that video?

Hope I've been helpful,
Bogdan Muresan.
 
Ok thanks, sorry I just misread the initial reply. Works fine now, thanks again everyone for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top