媒体播放器不会播放listView中的下一首歌曲,但是当我显示带有歌曲URL的消息框时,歌曲会播放

时间:2019-02-10 16:35:15

标签: vb.net visual-studio random

我有这个代码

 If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
            tempInt = gen.Next(0, listTracks.Items.Count - 1)
            currentTrack = tempInt
            If tempInt = playedBefore Then
                tempInt = gen.Next(0, listTracks.Items.Count - 1)
                currentTrack = tempInt
                AxWindowsMediaPlayer1.URL = listTracks.Items(tempInt)
            'here > MessageBox.Show(AxWindowsMediaPlayer1.URL)
                AxWindowsMediaPlayer1.Ctlcontrols.play()
                playedBefore = currentTrack
            Else
                currentTrack = tempInt
                AxWindowsMediaPlayer1.URL = listTracks.Items(tempInt)
            'here > MessageBox.Show(AxWindowsMediaPlayer1.URL)

                AxWindowsMediaPlayer1.Ctlcontrols.play()
                playedBefore = currentTrack
            End If

当歌曲结束时,下一首歌曲不播放。但是当我在消息框中显示歌曲的网址时,它将播放(标记为代码)

0 个答案:

没有答案