Drew
April 11th, 2001, 08:38 AM
What control would I use to be able to play a windows media player video
on my form .avi, .mpeg, .rm files? Would there be any code for this? Can
someone give me a code snippet? Is there something to set in the propertiees?
Joe Keller
April 11th, 2001, 02:58 PM
Here is some code using the MCI Multimedia control
Private Sub Form_Load ()
' Set properties needed by MCI to open.
MMControl1.Notify = FALSE
MMControl1.Wait = TRUE
MMControl1.Shareable = FALSE
MMControl1.DeviceType = "WaveAudio"
MMControl1.FileName = "C:\WINDOWS\MMDATA\GONG.WAV"
' Open the MCI WaveAudio device.
MMControl1.Command = "Open"
End Sub
This code plays a wave file. However by changing the DeviceType string you can change what type of media you want to play.
Here is a description from the MSDN
DeviceType Property (Multimedia MCI Control)
Specifies the type of MCI device to open.
Syntax
[form.]MMControl.DeviceType[ = device$]
Remarks
The argument device$ is the type of MCI device to open: AVIVideo, CDAudio, DAT, DigitalVideo, MMMovie, Other, Overlay, Scanner, Sequencer, VCR, Videodisc, or WaveAudio.
The value of this property must be set when opening simple devices (such as an audio CD that does not use files). It must also be set when opening compound MCI devices when the file-name extension does not specify the device to use.
Data Type
String
Good Luck
Joe
Drew
April 11th, 2001, 08:35 PM
Hey Joe Thanks for the answer. Is there any way to change the size of the window the movie is playing in? I woul like to make it bigger.