4

I want to display the list of songs in current playing lists, If users play music in my app, I could know what playlist is playing but if they were playing in zune app then switch to my app, my song list will be empty, even though the playlists is still running.

For example: if users's playing a playlists in windows phone 7 by Zune app, then they navigate to my App, how do I get that current play lists?

Nghia Nguyen
  • 2,585
  • 4
  • 25
  • 38

3 Answers3

3

The current Windows Phone 7 APIs only integrate with phone media via the MediaPlayerLauncher, which allows you to launch media from your application.

The Mango (7.1) APIs allow you to integrate with the media + video hub, however, the APIs are still pretty simple. You can determine the currently playing media via MediaHistory.NowPlaying.

ColinE
  • 68,894
  • 15
  • 164
  • 232
  • I know we are on the right track, however I still struggle a little bit how to use the MediaHistory class. For example, my listbox have data binding to listbox.ItemsSource = mySongsCollection; how do I get mySongCollection = MediaHistory.NowPlaying lists.... Thank you! – Nghia Nguyen Aug 05 '11 at 10:18
  • I tried to do something like this but didn't work, mySongCollection = MediaHistory.Instance.NowPlaying; I wonder what should be a right syntax. I started a new question. – Nghia Nguyen Aug 09 '11 at 01:45
  • this is GREAT, thanks for this. however, I have a question: how do you test this? can you upload a file to the emulator and play it? – SelAromDotNet Oct 20 '11 at 16:44
0

MediaHistory.NowPlaying is of Type MediaHistoryItem which has the Properties Title and ImageStream. You could add the Title and Image to your collection.

toolsche
  • 35
  • 5
0

You can use MediaPlayer.Queue property of static class MediaPlayer from Microsoft.Xna.Framework library

Stas Shusha
  • 528
  • 3
  • 11