Platform :

Popular Solution Go   Back

VB.NET - How to create media player application in VB.Net Sample

Step 1: Download Movie Player Pro SDK ActiveX installer 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 and drop a Movie Player Pro control onto the form.

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



Step 8: Add 4 buttons to the design surface of Form and label to Load Video, Play, Pause , Stop.

Step 9: Automatically add events to Load Video, Play , Pause, Stop button by double-clicking to let Visual Studio autogenerate the event method. 
Now, add these code to load the video, play, pause and stop the playback:

Private Sub btnloadvideo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnloadvideo.Click

AxMoviePlayer1.FileName = "c:\enteryourvideofile.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 the load video button, it will load the video file, then click play button to playback video.