BackgroundMediaPlayer architecture on Windows Phone 8.1
I posted this a while back on the MSDN Windows Phone Development forum. I think that it includes some really great information and I wanted to make sure to isolate and include it here for discoverability. The original thread can be found here for additional context.
Okay, let’s talk about the BackgroundMediaPlayer architecture a bit. Windows Phone 8 (WP8) was a three process architecture. Windows Phone 8.1 (WP8.1) is a two process architecture. I won’t go into how WP8 works. In WP8.1 you have a UI process and a background player process. The background player process is registered as a singleton instance OOPServer. This means that the background player will only be created if one does not already exist in the current app container.
The background player process contains your background audio code. Just like Windows 8 this process is given a PLM exemption that allows it to continue to run in the background while your UI process can be suspended. Once the exemption is registered, management of the background player process is handed off to the media manger. The media manager coordinates closely with the PLM to ensure there is only one active background player process at a given time. This means only one app can be playing audio in the background at any time.
-James