How to determine if background music is playing in WP8?

If someone has developed WP applications, before you find out that you can’t get certified if your application stops the music that is currently playing without user consent.

I saw this question here , which may have worked for WP7 applications, but it apparently doesn't work for WP8. I assume that this will not work because WP8 OS does not support XNA (this is only backward compatible, and if you developed the application using 7.1).

Can anyone find a solution for detecting background music in WP8.

+4
source share
2 answers

I believe that checking MediaPlayer.GameHasControl is what you are looking for. Use this property with other MediaPlayer members to comply with application certification guidelines. 6.5.1 Here is an example of a cross-cutting example of how @ http://henry-chong.com/2012/02/pro-tip-including-background-music-for-your-windows-phone-app/

BTW application certification requirements 6.5.x do not apply if your application is a Music + Video application. This is one way to solve 6.5.1 :)

+4
source

I believe that Microsoft.Xna.Framework.Media.MediaPlayer.State is still supported on Windows Phone 8 ( MSDN source ):

You can reference and use the following builds of the XNA Framework in applications targeting Windows Phone OS 8.0:

...

Microsoft.Xna.Framework.Media.dll

...

+2
source

All Articles