How to use window media player
I have just added a window media player in win form the question is how to play multiple songs,videos one by one automatically and the all the list of the songs displayed in a listBox as like our normal media player...
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
gunjan aroraRank #8,160 · 227 reputationPosted Apr 15, 2014, 10:02 PM EDT
The solution which I feel is to make another list box or take a dynamic array to add new songs.
2 ways are there -
1. you can add old as well as your new songs in that dynamic array along with old songs existing in listbox1.
2.inspite of directly binding the songs in listbox bind it into dynamic array and then clear your listbox just before adding the new songs into it.and then highlight the already selected song which is currently running as this will not effect the current song running as the current song residing in the buffer memory of window media player.
Hope this will help.
Nilesh AvhadRank #3,587 · 406 reputationPosted Apr 10, 2014, 6:36 AM EDT
Refer
http://msdn.microsoft.com/en-us/library/windows/desktop/dd562851(v=vs.85).aspx
http://stackoverflow.com/questions/15025626/playing-a-mp3-file-in-a-winform-application
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 13, 2014, 12:45 AM EDT
http://stackoverflow.com/questions/8970106/resume-a-paused-mp3-file-in-c-sharp-winforms-using-wmplib-windowsmediaplayer
Ajay Kadian128 reputationPosted Apr 13, 2014, 2:33 AM EDT
Thanks
Amit Ziv42 reputationPosted Apr 13, 2014, 8:57 AM EDT
1. make sure your openfiledialog.multiselect = true;
2. make sure your listbox index inputs are correct.
3. if u still cant find the problem, put breakpoints in the nextsong method and check why the index is out of bounds..
and i really dont know anything about how to enable those...
P.S if you could upload your code i might be able to edit it..
Ajay Kadian128 reputationPosted Apr 13, 2014, 9:36 AM EDT
Amit Ziv42 reputationPosted Apr 13, 2014, 10:49 AM EDT
try to get the current index length and add to it the number of files you have added to the list..
Ajay Kadian128 reputationPosted Apr 14, 2014, 7:39 AM EDT
thanks
gunjan aroraRank #8,160 · 227 reputationPosted Apr 14, 2014, 10:37 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 14, 2014, 11:16 PM EDT
http://www.youtube.com/watch?v=xlIZQed46Jw
Ajay Kadian128 reputationPosted Apr 15, 2014, 12:40 AM EDT
That's the problem and i m using a soundcard.
gunjan aroraRank #8,160 · 227 reputationPosted Apr 15, 2014, 12:56 AM EDT
Amit Ziv42 reputationPosted Apr 17, 2014, 1:41 PM EDT
not cool man...
Ajay Kadian128 reputationPosted Apr 18, 2014, 12:51 AM EDT
And please delete your thread in which you provided the code.
Amit Ziv42 reputationPosted Apr 19, 2014, 7:13 AM EDT
Ajay Kadian128 reputationPosted Apr 19, 2014, 8:25 AM EDT