Back to monogame.net
Show / Hide Table of Contents

Class MediaPlayer

Inheritance
Object
MediaPlayer
Namespace: Microsoft.Xna.Framework.Media
Assembly: MonoGame.Framework.dll
Syntax
public static class MediaPlayer : object

Properties

GameHasControl

Declaration
public static bool GameHasControl { get; }
Property Value
Type Description
Boolean

IsMuted

Declaration
public static bool IsMuted { get; set; }
Property Value
Type Description
Boolean

IsRepeating

Declaration
public static bool IsRepeating { get; set; }
Property Value
Type Description
Boolean

IsShuffled

Declaration
public static bool IsShuffled { get; set; }
Property Value
Type Description
Boolean

IsVisualizationEnabled

Declaration
public static bool IsVisualizationEnabled { get; }
Property Value
Type Description
Boolean

PlayPosition

Declaration
public static TimeSpan PlayPosition { get; }
Property Value
Type Description
TimeSpan

Queue

Declaration
public static MediaQueue Queue { get; }
Property Value
Type Description
MediaQueue

State

Declaration
public static MediaState State { get; }
Property Value
Type Description
MediaState

Volume

Declaration
public static float Volume { get; set; }
Property Value
Type Description
Single

Methods

MoveNext()

Declaration
public static void MoveNext()

MovePrevious()

Declaration
public static void MovePrevious()

Pause()

Declaration
public static void Pause()

Play(Song)

Play clears the current playback queue, and then queues up the specified song for playback. Playback starts immediately at the beginning of the song.

Declaration
public static void Play(Song song)
Parameters
Type Name Description
Song song

Play(Song, Nullable<TimeSpan>)

Play clears the current playback queue, and then queues up the specified song for playback. Playback starts immediately at the given position of the song.

Declaration
public static void Play(Song song, TimeSpan? startPosition)
Parameters
Type Name Description
Song song
Nullable<TimeSpan> startPosition

Play(SongCollection, Int32)

Declaration
public static void Play(SongCollection collection, int index = 0)
Parameters
Type Name Description
SongCollection collection
Int32 index

Resume()

Declaration
public static void Resume()

Stop()

Declaration
public static void Stop()

Events

ActiveSongChanged

Declaration
public static event EventHandler<EventArgs> ActiveSongChanged
Event Type
Type Description
EventHandler<EventArgs>

MediaStateChanged

Declaration
public static event EventHandler<EventArgs> MediaStateChanged
Event Type
Type Description
EventHandler<EventArgs>
In This Article
Back to top

© 2012 Microsoft Corporation. All rights reserved.

© The MonoGame Team.