O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Background Audio Player

The BackgroundAudioPlayer class implements the singleton pattern. The single instance of the BackgroundAudioPlayer is accessed in your foreground app via its static Instance property, as shown:

BackgroundAudioPlayer.Instance.Track    = new AudioTrack(             new Uri("http://example.com/Audio.mp3", UriKind.Absolute),             "Track Name", "Artist", "Album", null);BackgroundAudioPlayer.Instance.Play();

The behavior of the BackgroundAudioPlayer changes depending on whether it is being used in your foreground app or from an AudioPlayerAgent. When the BackgroundAudioPlayer is used in your foreground app, all calls are relayed to your AudioPlayerAgent. When used from an AudioPlayerAgent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required