Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitlePlay an AVI video
KeywordsAVI, video, play, MMC, multimedia control
CategoriesMultimedia, 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated