'create playlist Dim newPlayList As WMPLib.IWMPPlaylist = wmpControl.playlistCollection.newPlaylist("soundsToPlay") newPlayList.appendItem(wmpControl.newMedia("C:\Sample1.mp3")) newPlayList.appendItem(wmpControl.newMedia("C:\Sample2.mp3")) 'play the list wmpControl.Visible = False wmpControl.currentPlaylist = newPlayList wmpControl.stretchToFit = True wmpControl.Ctlcontrols.play()
9 thoughts on “Creating & Playing Playlist – VB.Net Windows Media Player Control”
I think this is one of the most important info for me.
And i’m glad reading your article. But should remark on few general things, The site style is great, the articles is really excellent : D. Good job, cheers
pretty nice your code, really helpfull!!! thanks!!
I got some question:
1. It is posible to see the playlist ? like in the “normal” media player ? If it is possible, how to do it by code???
You could get the contents of the playlist using the below and display any way you wish:
Dim i As Integer = 0
For i = 0 To wmpControl.currentPlaylist.count - 1
Dim pListItem As WMPLib.IWMPMedia = wmpControl.currentPlaylist.Item(i)
'do something with the playlist item (add to a list or panel)
help me with the interface so that i get the concept very well
thanks it is very helpfull to me
tq..i’m glad to read this article after many trial i had try..and this code usefull for me. i just change a little because the video not appear..this is the code..
Dim newPlayList As WMPLib.IWMPPlaylist = AxWindowsMediaPlayer1.playlistCollection.newPlaylist(“soundsToPlay”)
‘play the list
AxWindowsMediaPlayer1.Visible = True
AxWindowsMediaPlayer1.currentPlaylist = newPlayList
AxWindowsMediaPlayer1.stretchToFit = True
Here is a link to a complete Playlist Creator Program that I just made. It does *.m3u, and *.wpl playlists. https://1drv.ms/u/s!AqFWJpjpd8nPiUnu1wVcNVTQOMGZ Hope you Enjoy It. Needs framework 4.5 and Windows 10 with WMP version 12.0.10011.16384