开发者

how to use MediaHistory.NowPlaying Property to get current playing list in windows phone 7

开发者 https://www.devze.com 2023-03-26 15:20 出处:网络
how can I get the curr开发者_Go百科ent playing list that is playing by \"music + video\" app. The only thing I can get so far is the current playing song, but users will have no idea what is the next

how can I get the curr开发者_Go百科ent playing list that is playing by "music + video" app. The only thing I can get so far is the current playing song, but users will have no idea what is the next song or what list is being played.

I check this http://msdn.microsoft.com/en-us/library/ff769558%28VS.92%29.aspx but it's about updating the hub. I want to update my app.....

For example, if I let's user choose to play 3rd Album in the Hub, I do it like this:

mySongCollection = library.Albums[3].Songs;

and to update my lists I use:

listbox.Itemssource = mySongCollection;

how can I get the current playing list from hub to mySongCollection list?


One way would be to loop through the MediaPlayer.Queue:

for(int i = 0; i < MediaPlayer.Queue.Count; i++)
{         
    Debug.WriteLine(MediaPlayer.Queue[i].Artist.Name);

    //to add the song to the listbox
    playListLb.Items.Add(MediaPlayer.Queue[i]);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消