windows media player

R

Ringo

I'm trying to use windows media player in an app. I can give it an mp3
and it plays it, but if I give it a playlist it will not play and even
the play button on the control is not active.

btn_open_mediaFile works fine,
tn_open_playlist acts likes nothing happened except I see the name of
the playlist. What am I missing?
Also, if an mo3 is playing, loading a playlist stops it from playing.
here is my code


private void btn_open_mediaFile_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "music|*.mp3";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.URL = filename;
}

private void btn_open_playlist_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "playlists|*.wpl";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.currentPlaylist =
player.mediaCollection.getByName(filename);
currentPlaylistLabel.Text = ("Found first playlist. Name =
" + player.currentPlaylist.name);
player.Ctlcontrols.play();// does not work with or without
this line
}

any help would be greatly appreciated
Thanks
Ringo
 
N

Nicholas Paldino [.NET/C# MVP]

Ringo,

I'm just guessing, but it could be that the media collection that you
are accessing doesn't have the playlist loaded yet. Is there a method to
load the playlist from the filename?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top