how to play avi file using vb.net ?? preferable with full screen mode

help me to do this.

Recommended Answers

you can also use media player control object.
add this from component.

on the form load

Me.WindowState = FormWindowState.Maximized
AxMediaPlayer1.FileName = "C:\movie1.avi"
AxMediaPlayer1.Play()
AxMediaPlayer1.ShowControls = False
AxMediaPlayer1.AllowChangeDisplaySize = False
AxMediaPlayer1.EnableContextMenu = False
AxMediaPlayer1.ClickToPlay = False
AxMediaPlayer1.SendKeyboardEvents = False
Me.Cursor.Hide()


At the end of stream event

Private Sub …
Jump to Post

All 4 Replies

use a Process, and simply "run" the file (If you happen to know the parameters for launching in fullscreen, then add that too).

Dim prc As New Process
        prc.StartInfo.FileName = "C:\mediafile.avi"
        prc.StartInfo.Arguments.Insert(0, "-Fullscreen")
        prc.Start()
commented: thx buddy +1

you can also use media player control object.
add this from component.

on the form load

Me.WindowState = FormWindowState.Maximized
AxMediaPlayer1.FileName = "C:\movie1.avi"
AxMediaPlayer1.Play()
AxMediaPlayer1.ShowControls = False
AxMediaPlayer1.AllowChangeDisplaySize = False
AxMediaPlayer1.EnableContextMenu = False
AxMediaPlayer1.ClickToPlay = False
AxMediaPlayer1.SendKeyboardEvents = False
Me.Cursor.Hide()


At the end of stream event

Private Sub AxMediaPlayer1_EndOfStream(ByVal sender As Object, ByVal e As AxMediaPlayer._MediaPlayerEvents_EndOfStreamEvent) Handles AxMediaPlayer1.EndOfStream

AxMediaPlayer1.FileName = "C:\movie2.avi"
AxMediaPlayer1.Play()

End Sub

on the form unload , set back the cursor

Me.Cursor.Show()
commented: thanks again buddy +1
commented: Great +1

thank you...

you're welcome friend :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.