none
How to play songs automatically from play list?

    Question

  • i am currently making windows media player in c#. I want to play songs automatically from my play list.But unfortunately after a lot of try i am still unable.Here is my code :

    string auto[];
    public void AutoPlay(AxWMPLib.AxWindowsMediaPlayer play, ListBox lb)
    {
    for (int i = 0; i < files.Length; i++)
    {
    auto[i] = lb.SelectedItems.ToString();
    play.URL = auto[i];
    }

    Monday, May 1, 2017 1:12 PM

All replies

  • Hi Tanzeel23,

    Thank you for posting here.

    For your question, what is the play songs automatically mean? Do you want play songs in a loop?

    Please refer to the article, it shows an example about how to play songs in playlist.

    http://www.timwylie.com/playlist.html

    I hope this would b helpful.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 2, 2017 2:07 AM
    Moderator
  • Consider the next method too: use playlistCollection.newPlaylist function of the player control, then add songs using appendItem and newMedia, then assign the playlist to currentPlaylist.

    Tuesday, May 2, 2017 6:51 AM