Table of Contents

Class MediaPlayer

Namespace
Microsoft.Xna.Framework.Media
Assembly
MonoGame.Framework.dll
public static class MediaPlayer
Inheritance
MediaPlayer
Inherited Members

Properties

GameHasControl

public static bool GameHasControl { get; }

Property Value

bool

IsMuted

public static bool IsMuted { get; set; }

Property Value

bool

IsRepeating

public static bool IsRepeating { get; set; }

Property Value

bool

IsShuffled

public static bool IsShuffled { get; set; }

Property Value

bool

IsVisualizationEnabled

public static bool IsVisualizationEnabled { get; }

Property Value

bool

PlayPosition

public static TimeSpan PlayPosition { get; }

Property Value

TimeSpan

Queue

public static MediaQueue Queue { get; }

Property Value

MediaQueue

State

public static MediaState State { get; }

Property Value

MediaState

Volume

public static float Volume { get; set; }

Property Value

float

Methods

MoveNext()

public static void MoveNext()

MovePrevious()

public static void MovePrevious()

Pause()

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.

public static void Play(Song song)

Parameters

song Song

Play(Song, 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.

public static void Play(Song song, TimeSpan? startPosition)

Parameters

song Song
startPosition TimeSpan?

Play(SongCollection, int)

public static void Play(SongCollection collection, int index = 0)

Parameters

collection SongCollection
index int

Resume()

public static void Resume()

Stop()

public static void Stop()

Events

ActiveSongChanged

public static event EventHandler<EventArgs> ActiveSongChanged

Event Type

EventHandler<EventArgs>

MediaStateChanged

public static event EventHandler<EventArgs> MediaStateChanged

Event Type

EventHandler<EventArgs>