Friday, December 10, 2010

Creation of Media Player Application

How to create media player application in VB.Net Sample
Step 1: Download movie player pro ActiveX setup disk and installed it.
Step 2: Create New Visual Basic Project, select Windows Application.
Step 3: Select Component Tab in Toolbox, Right Click mouse and Select Add/Remove Items...


Step 4: Select Component Tab in Toolbox, Right Click mouse and Select Add/Remove Items...
Step 5: In Customize Toolbox, select COM Components Tab, Select MoviePlayer Pro ActiveX.

.
Step 6: Drag the movie player pro icon into the form.

Step 7: Add 4 buttons into the form and label to Load Video, Play, Pause , Stop.


Step 8: Add 4 buttons into the form and label to Load Video, Play, Pause , Stop.

Step 9: Add following code in buttons click event. You need change the correct path of your video in FileName property.
Private Sub btnloadvideo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnloadvideo.Click
AxMoviePlayer1.FileName = "c:\inputyourvideofile.mpg"
End Sub
Private Sub btnplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnplay.Click
AxMoviePlayer1.Play()
End Sub
Private Sub btnpause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpause.Click
AxMoviePlayer1.Pause()
End Sub
Private Sub btnstop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstop.Click
AxMoviePlayer1.Stop()
End Sub

Step 10: Now click load video button, it will load the video file, click play button to playback video.

No comments:

Post a Comment

social media buttons