|
|
Title | Play an AVI video |
Keywords | AVI, video, play, MMC, multimedia control |
Categories | Multimedia, Controls |
|
|
Use the MCI multimedia control.
|
|
Private Sub Form_Load()
Dim file_name As String
file_name = App.Path
If Right$(file_name, 1) <> "\" Then file_name = _
file_name & "\"
txtFilename.Text = file_name & "Gears.avi"
' Prepare the MCI control for AVI video.
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "AVIVideo"
End Sub
' Open the device and play the sound.
Private Sub cmdPlay_Click()
' Set the file name.
MMControl1.filename = txtFilename.Text
' Open the MCI device.
MMControl1.Wait = True
MMControl1.Command = "Open"
' Play the video.
MMControl1.Wait = True
MMControl1.Command = "Play"
' Close the device.
MMControl1.Command = "Close"
End Sub
|
|
|
|
|
|