5
Contributors
4
Replies
23
Views
4 Years
Discussion Span
Last Post by xarhang
0

First you must add the component. (ctrl+T or project->component) then select for Windows Media Player.
You will see new control and just add it to your form.
try this to play a video :

WindowsMediaPlayer1.openPlayer "D:\father.mp4"
0
  1. Add OpenFileDialog
  2. Add Windows media Player (R Click Tools And Choose Add Item>> COM Compoments >> Corect Windows Media Player And Then You Can See Windows Media Player)
  3. Add 1 Button

    double Click Button And Try This Code

    OpenFileDialog1.ShowDialog()
    AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
    AxWindowsMediaPlayer1.Ctlcontrols.play()
    

    Here is Full Code

    Public Class m

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
        AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
        AxWindowsMediaPlayer1.Ctlcontrols.play()
    End Sub
    

    End Class

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.