Provides methods and properties to play, pause, resume, and stop songs. MediaPlayer also exposes shuffle, repeat, volume, play position, and visualization capabilities.
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
public static class MediaPlayer
MediaPlayer provides methods and properties for playing songs in the media library.
To control song playback, use the Play, Pause, Stop, and Resume methods. The MoveNext and MovePrevious methods move to the next or previous song in the queue. They operate as if the queue was circular. That is, MoveNext, when the last song is playing, moves to the first song. MovePrevious, when the first song is playing, moves to the last song.
To obtain visualization data for the currently playing song, call GetVisualizationData.
MediaPlayer is a static class, so you do not have to use new to instantiate an instance of the class. Instead, call methods and properties directly on the class.
Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone