Post by lotus on Mar 28, 2015 20:51:29 GMT 10
Hey, its me again :v im having a problem in my wmp player. after i load my playlist on a listbox and finish the first song selected it wont play the next song although it did select the next item on the listbox no audio is playing.. this is the code im working with atm: Public Class BIMP
Dim songnames As String() Dim paths As String() #Region "Test" Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListPanel.SelectedIndexChanged MP.URL = paths(ListPanel.SelectedIndex) LabelMediaName.Text = ListPanel.SelectedItem End Sub
#End Region Private Sub SongEnd_MediaEnded(sender As Object, e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles MP.PlayStateChange If MP.playState = WMPLib.WMPPlayState.wmppsStopped Then ListPanel.SelectedIndex = ListPanel.SelectedIndex + 1 MP.URL = ListPanel.SelectedItem MP.Ctlcontrols.play()
End If End Sub #Region "Functions" Private Sub ButtonShowPlaylist_Click(sender As Object, e As EventArgs) Handles ButtonShowPlaylist.Click
Do Until Panel2.Height = 133 Panel2.Height = Panel2.Height + 1 Loop Panel2.Visible = True
End Sub Private Sub OpenFileToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenFileToolStripMenuItem.Click
If OPD.ShowDialog = Windows.Forms.DialogResult.OK Then songnames = OPD.SafeFileNames paths = OPD.FileNames For i As Integer = 0 To songnames.Length - 1 ListPanel.Items.Add(songnames(i))
Next
End If End Sub Private Sub ButtonAddPlaylist_Click(sender As Object, e As EventArgs) Handles ButtonAdd.Click
If OPD.ShowDialog = Windows.Forms.DialogResult.OK Then songnames = OPD.SafeFileNames paths = OPD.FileNames For i As Integer = 0 To songnames.Length - 1 ListPanel.Items.Add(songnames(i)) Next
End If
End Sub #End Region
End Class
i want my media player to play whenever there is next song in the list here's the SS of my Player. in this part. The first song is playing. and after the first song finished it selects the next but no audio is playing PS: i didnt put the code in the trackbar and the buttons below yet. Cheers,
|
|
Post by Nathan Lecompte on Mar 29, 2015 17:07:55 GMT 10
Hey lotus , You're setting the media file URL/path to the actual name of the song/filename which isn't a valid path, the reason why it plays the first song is because then the URL/path has been directly set (most likely). Try something like this: www.dreamincode.net/forums/topic/66086-wmp-playlist/Hope this helps!
|
|
Post by lotus on Mar 29, 2015 19:15:38 GMT 10
by searching base on the link that you gave i found my answer in here : www.youtube.com/watch?v=BtQYEGEKJzw btw my browser project will be presented in the panel on april 6 that's why im in a rush wish me luck in my defense cheers !
|
|
Post by Nathan Lecompte on Mar 29, 2015 19:53:11 GMT 10
Ok nice! Good luck and I hope it all goes well
|
|