1
votes

I'm working on a Win Phone 8.1 App that uses the background audio player, but I'm having trouble, particularly when it comes to the cancellation event. I want to debug it myself to learn but I can't seem to find a way to manually cancel the background task other than to pause and wait 5 minutes while the app is suspended, something impossible while debugging.

Is there a way to do so cleanly (ie. Not artificially increasing memory usage)?

1

1 Answers

1
votes

There come two ways to my mind, both quite easy to do:

  • invoke BackgroundMediaPlayer.Shutdown from your code

  • while debugging, hit Start, find Music app, open, start playing an audio file - hence there can be only one Instance of MediaPlayer, yours will be cancelled.