|
|
Title | Play an MPEG file using ActiveMovie |
Keywords | MPG, MPEG, video, play, ActiveMovie |
Categories | Multimedia |
|
|
Create a filter graph manager and invoke its RenderFile method. Use an IMediaEvent's WaitForCompletion method to wait until the file is done.
|
|
' Open the device and play the sound.
Private Sub cmdPlay_Click()
Dim media_control As Object
Dim media_event As IMediaEvent
Dim event_code As Long
' Get an object on the filter graph manager
Set media_control = New FilgraphManager
' Open the file and build a filter graph
media_control.RenderFile txtFilename.Text
' Play the file.
media_control.Run
' Get the IMediaEvent interface
Set media_event = media_control
' Wait for the video to finish
media_event.WaitForCompletion 99999, event_code
' Free all interfaces
Set media_event = Nothing
Set media_control = Nothing
End Sub
|
|
|
|
|
|