- Home
·
- Sound/MP3
·
- BASIC PRINCIPLE: USE OF MCI32.OCX FOR PLAYING MPEGVIDEO
BASIC PRINCIPLE: USE OF MCI32.OCX FOR PLAYING MPEGVIDEO
BASIC PRINCIPLE: USE OF MCI32.OCX FOR PLAYING MPEGVIDEO
API Declarations
'The principle so MPEGVideo can be played on some VB control are as follows
'1. Select DeviceType i.e., "MPEGVideo" that has been registered in SYSTEM.INI in section [MCI]
'2. Select filename of MPEGVideo
'3. Select VB Control to display MPEGVideo (PictureBox, Form etc)
'4. Open file of MPEGVideo
'5. PLAY/PAUSE/STOP
'6. Close file of MPEGVideo
Rate BASIC PRINCIPLE: USE OF MCI32.OCX FOR PLAYING MPEGVIDEO
(2(2 Vote))
'-------------------------------------------------------------------------------
Private Sub Form_Load()
MCI1.DeviceType="MPEGVideo"
'It must be registered in SYSTEM.INI section [MCI]
MCI1.Filename="e:\mpegav\avseq01.dat"
'Assumed that your CDROM drive is "E" and VCD has already inserted
MCI1.HwndDisplay=Me.hWnd
'It will display the movie on Form, If you want to play on picturebox
'replace MCI1.hwndDisplay=Picture1.hWnd
MCI1.Command="Open"
'Now Your VCD is ready to play, just click PLAY button of MCI Control
End Sub
'How to know percentage of running VCD? See following code:
Private Sub MCI1_StatusUpdate()
Dim nPCTG
nPCTG=MCI1.Position/MCI1.Length*100
Me.Caption= "Playing " & MCI1.filename & ": " & Format(nPCTG,"00.0") & " %"
'The Percentage displays on Title Form Bar
End Sub
'Preventing error after application ending, MPEGVideo file must be closed
Private Sub Form_QueryUnload()
MCI1.Command="Close"
End Sub
'How easy is it?
'More?? Contact me.
BASIC PRINCIPLE: USE OF MCI32.OCX FOR PLAYING MPEGVIDEO Comments
No comments yet — be the first to post one!
Post a Comment