Question

I'm programming an app which is able to play music in background. I'm using mediaplayer and Song(class xnalib), well since is not possible put file into mediaplayer.queue I can't figure out how can play next song in the "playlist". I'll try to make this scenario more clear with an example:

  • I play music with mediaplayer: MediaPlayer.Play(MysongArray[CurrentIndex]);
  • well now user put my app in background.

  • but when MysongArray[CurrentIndex] song is ended how play next song if my application is in background?

thanks

Was it helpful?

Solution

That's probably because you are playing a Song not a SongCollection - once it's ended it stops playing. Source: MSDN1, MSDN2. I belive (thounght I've not tried it) that you should create SongCollection (if it's possible) or Manage existing one. But this can be a hard job as @ToniPetrina answered here.

As for me I would consider using Background Audio Player and How to play.
Maybe this will help if you decide to use BAP - example how to use playlist.

OTHER TIPS

You cannot do that since background player can only stream or play from isolated storage. You cannot play songs from MediaLibrary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top