0 out of 4 rated this helpful - Rate this topic

BackgroundAudioPlayer Class

July 26, 2012

Provides background access to audio playback functionality such as play, pause, fast-forward, and rewind.

System.Object
  Microsoft.Phone.BackgroundAudio.BackgroundAudioPlayer

Namespace:  Microsoft.Phone.BackgroundAudio
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public sealed class BackgroundAudioPlayer

The BackgroundAudioPlayer type exposes the following members.

  NameDescription
Public propertyBufferingProgressThe amount of buffering that is completed for the media content.
Public propertyCanPauseGets a value indicating whether the media can be paused when the Pause() method is called.
Public propertyCanSeekGets a value indicating whether the media can be repositioned by setting the value of the Position property.
Public propertyErrorThe last error, if any, to have occurred while playing the current AudioTrack.
Public propertyStatic memberInstanceReturns an instance of the BackgroundAudioPlayer. If this application already has background audio playback resources allocated, the BackgroundAudioPlayer returned will contain references to those resources.
Public propertyPlayerStateGets the current PlayState of the player.
Public propertyPositionGets or sets the current position within the current Track.
Public propertyTrackGets or sets the current track for this application, whether it is currently playing or not.
Public propertyVolumeThe media's volume represented on a linear scale between 0 and 1. The default is 0.85.
Top
  NameDescription
Public methodCloseCloses the player and removes all resources reserved for it, including the current AudioTrack.
Public methodEquals (Inherited from Object.)
Public methodFastForwardStarts fast-forwarding through the current AudioTrack.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPausePauses playback at the current position.
Public methodPlayPlays or resumes the current AudioTrack at its current position.
Public methodRewindStarts rewinding through the current AudioTrack.
Public methodSkipNextSkips to the next track.
Public methodSkipPreviousSkips to the previous track.
Public methodStopStops and resets media to be played from the beginning.
Public methodToString (Inherited from Object.)
Top
  NameDescription
Public eventPlayStateChangedOccurs when the PlayState changes.
Top

This is the main class for performing playback options and registering for PlayStateChanged events independent of which playlist is currently playing. It is used by both the foreground application and the background agent. Rather than relying on events, the background agent relies on callbacks.

Windows Phone OS

Supported in: 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.