Creating a Custom Audio Player Agent

An audio player agent can be created by selecting the Windows Phone Audio Playback Agent project type from the Visual Studio New Project dialog (see Figure 34.1). This produces a new project that includes a class that derives from AudioPlayerAgent.

Image

FIGURE 34.1 Visual Studio Windows Phone agent projects.

When you link to an Audio Player Agent project from your main project, a BackgroundServiceAgent task definition is added to your main project’s WMAppManifest.xml file, resembling the following:

<Tasks>  <DefaultTask  Name="_default" NavigationPage="MainPage.xaml"/>  <ExtendedTask ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.