Private Sub Command1_Click()
    Timer1.Enabled = False
    WindowsMediaPlayer1.Controls.play
    Dim str As String
    str = WindowsMediaPlayer1.currentMedia.getItemInfo("Duration")
    Debug.Print str
    Debug.Print WindowsMediaPlayer1.currentMedia.getItemInfo("Title")
End Sub

Private Sub Command2_Click()
    Timer1.Enabled = True
End Sub

Private Sub Form_Load()
    Timer1.Interval = 1000
    Timer1.Enabled = False
    WindowsMediaPlayer1.settings.autoStart = False
    WindowsMediaPlayer1.URL = "F:\test.avi"
    Debug.Print WindowsMediaPlayer1.currentMedia.duration
    Debug.Print WindowsMediaPlayer1.currentMedia.durationString
End Sub

Private Sub Timer1_Timer()
    Debug.Print "position = " & WindowsMediaPlayer1.Controls.currentPosition
    If WindowsMediaPlayer1.Controls.currentPosition + 4 >= WindowsMediaPlayer1.currentMedia.duration Then
        WindowsMediaPlayer1.Controls.stop
        Timer1.Enabled = False
        Exit Sub
    End If
    WindowsMediaPlayer1.Controls.currentPosition = WindowsMediaPlayer1.Controls.currentPosition + 4
    Debug.Print "String = " & WindowsMediaPlayer1.Controls.currentPositionString
End Sub

Private Sub WindowsMediaPlayer1_OpenStateChange(ByVal NewState As Long)
    If NewState = 13 Then
         Debug.Print WindowsMediaPlayer1.currentMedia.durationString
     End If
End Sub