Information on the Windows Phone Audio Playback Agent seems to be somewhat scarce, and the only real article I can find is the one from MSDN.
Unfortunately, the implementation in the sample is not practical for most apps, as they use a static list of AudioTracks contained within the Audio Playback Agent class library. For most apps, I'd imagine they would have a dynamic list of AudioTracks managed within the application's main project (ie. View Model or something similar). The issue here though, is that there doesn't seem to be an effective way for the Audio Playback Agent to communicate with the rest of the application. I know I can register for the BackgroundAudioPlayer.Instance.PlayStateChanged event, but there is no event for SkipPrevious or SkipNext.
Asked simply -- if you manage your AudioTracks outside of the Audio Playback Agent project, how can you handle when a user uses the SkipPrevious/SkipNext buttons on the Universal Volume Control (UVC)?
You need to move the logic around what tracks to play into the agent (or a library the agent can use). This is necessary as the agent must be abel to run even when the app isn't running.
The only way to track what is happening in the agent from you app is to subscribe to the
BackgroundAudioPlayer.Instance.PlayStateChanged
event. This will be fired when the universal controls are used.As you've noted this greatly limits the amount if information you can include in the app (compared with MediaElement, for instance).
Important Be careful that any logic you move into the agent (or a library referenced by the agent) does not use any of the restricted APIs as even if they're in an assembly referenced by the agent and not used the static analysis of the agent done by marketplace certification will cause it to fail.