WP8.1 Certification - 6.5.1 - Initial launch functionality using XAML/C++
-
20-12-2019 - |
Question
Prior to WP8.1, we've used C#/XAML along with C++ interop project. With WP8.1, we've decided to migrate to the universal apps and support Windows 8.
One of the things we're wondering if it's possible to check if the user has background music playing. This was an issue with our first games on WP7 and WP8.
You can read more about the certification here: http://msdn.microsoft.com/library/windows/apps/hh184838(v=vs.105).aspx
With C# and WP8 we used to be able to simply check Microsoft.Xna.Framework.Media.MediaPlayer.GameHasControl
. Is there anything similar with C++/XAML DirectX app on WP8.1 or do we simply skip the 6.5.1 requirement?
Solution
In Windows Phone 8.1 Runtime you have a BackgroundPlayer class, it has a property BackgroundMediaPlayer.IsMediaPlaying, which you can use for checking for background music playing.
Note that this is only for Windows Phone, so for other devices you will have to use other methods.