wmp快速播放自实现

页面导航:首页 > 软件编程 > vb.net > wmp快速播放自实现

wmp快速播放自实现

来源: 作者: 时间:2016-01-15 15:10 【

Private Sub Command1_Click() Timer1.Enabled = False WindowsMediaPlayer1.Controls.play Dim str As String str = WindowsMediaPlayer1.currentMedia.getItemInfo(Dur...
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

 

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<