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

help me to do this.

Recommended Answers

use a Process, and simply "run" the file (If you happen to know the parameters for launching in fullscreen, then add that too).
[code=vb.net]Dim prc As New Process
prc.StartInfo.FileName = "C:\mediafile.avi"
prc.StartInfo.Arguments.Insert(0, "-Fullscreen")
prc.Start()[/code]

Jump to Post

you can also use media player control object.
add this from component.
[code=vb.net]
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 …

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 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.