Search code examples
c#.netwindows-phone-7media-player

How to detect if another audio is playing in background? (Windows Phone 7)


One of my apps have recently failed certification because: "my app stops background music without asking user when it wants to play some music".

Now the question is: how can we detect if there is any music playing in the background?

Regards


Solution

  •   using Microsoft.Xna.Framework.Media;
    

    ...

        if (Microsoft.Xna.Framework.Media.MediaPlayer.State == MediaState.Playing)
        {
              ....
        }