Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
i am trying to develop a media player using windows media player component in c#.net. this is my code by which i can make play list and add the songs to the playlist and the name of the playlist will be shown in the listbox named "playlistviewbar" and then i have set this playlist to current playlist.
 
but when i run the project and current plaulist set it ask to play the media that is not match wich player. it shows that it has extension "." and it fails to play the media
 
can any one help me to resolve this problem and also help me for saving the playlist..
 
plzzzzzzzzzz help.. thnx
WMPLib.IWMPPlaylist pl;
 public WMPLib.IWMPMedia files1,paths1;
 string playListName;
 
    private void toolStripButton3_Click(object sender, EventArgs e)
    {
        if (listnametxt.Text == "")
        {
            playListName = "Untitled playlist";
        }
        else
        {
            playListName = listnametxt.Text;
        }
        pl = axWindowsMediaPlayer1.playlistCollection.newPlaylist(playListName);
        playlistviewbar.Items.Add(playListName);
 
    }
 
    private void toolStripButton2_Click(object sender, EventArgs e)
    {
        if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
        {
            string[] filestring=openFileDialog2.SafeFileNames;
             string[] pathstring=openFileDialog2.FileNames;
            for (int i = 0; i < filestring.Length; i++)
            {
            files1 = axWindowsMediaPlayer1.newMedia(filestring[i]);
            paths1 = axWindowsMediaPlayer1.newMedia(pathstring[i]);
            pl.appendItem(paths1);
            axWindowsMediaPlayer1.currentPlaylist =pl;
            }
 

        }
    }
Posted 23-Feb-13 23:51pm
Comments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,725
1 OriginalGriff 6,696
2 CPallini 5,315
3 George Jonsson 3,589
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100