Table of Contents

Class MediaPlayer

Namespace
Loehnert.Controls
Assembly
Loehnert.Controls.dll

Represents a media player to play video and audio files.

public class MediaPlayer : UserControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged, IComponentConnector
Inheritance
MediaPlayer
Implements
Inherited Members

Constructors

MediaPlayer()

Initializes a new instance of the MediaPlayer class.

public MediaPlayer()

Fields

AllowPlayPauseOnClickProperty

Identifies the AllowPlayPauseOnClick dependency property.

public static readonly DependencyProperty AllowPlayPauseOnClickProperty

Field Value

DependencyProperty

CanControlTimelineProperty

Identifies the CanControlTimeline dependency property.

public static readonly DependencyProperty CanControlTimelineProperty

Field Value

DependencyProperty

CurrentMediaIndexProperty

Identifies the CurrentMediaIndex dependency property.

public static readonly DependencyProperty CurrentMediaIndexProperty

Field Value

DependencyProperty

HasVideoProperty

Identifies the HasVideo dependency property.

public static readonly DependencyProperty HasVideoProperty

Field Value

DependencyProperty

IsAutoPlayProperty

Identifies the IsAutoPlay dependency property.

public static readonly DependencyProperty IsAutoPlayProperty

Field Value

DependencyProperty

IsMutedProperty

Identifies the IsMuted dependency property.

public static readonly DependencyProperty IsMutedProperty

Field Value

DependencyProperty

IsPausedProperty

Identifies the IsPaused dependency property.

public static readonly DependencyProperty IsPausedProperty

Field Value

DependencyProperty

IsPlayingProperty

Identifies the IsPlaying dependency property.

public static readonly DependencyProperty IsPlayingProperty

Field Value

DependencyProperty

IsStopedProperty

Identifies the IsStoped dependency property.

public static readonly DependencyProperty IsStopedProperty

Field Value

DependencyProperty

IsTransparentOnStopProperty

Identifies the IsTransparentOnStop dependency property.

public static readonly DependencyProperty IsTransparentOnStopProperty

Field Value

DependencyProperty

RepeatMediaProperty

Identifies the RepeatMedia dependency property.

public static readonly DependencyProperty RepeatMediaProperty

Field Value

DependencyProperty

RepeatQueueProperty

Identifies the RepeatQueue dependency property.

public static readonly DependencyProperty RepeatQueueProperty

Field Value

DependencyProperty

ShowControlBarProperty

Identifies the ShowControlBar dependency property.

public static readonly DependencyProperty ShowControlBarProperty

Field Value

DependencyProperty

ShowPlayPauseStateIconProperty

Identifies the ShowPlayPauseStateIcon dependency property.

public static readonly DependencyProperty ShowPlayPauseStateIconProperty

Field Value

DependencyProperty

ShowPlayProperty

Identifies the ShowPlay dependency property.

public static readonly DependencyProperty ShowPlayProperty

Field Value

DependencyProperty

ShowPlaylistProperty

Identifies the ShowPlaylist dependency property.

public static readonly DependencyProperty ShowPlaylistProperty

Field Value

DependencyProperty

ShowSkipControlsProperty

Identifies the ShowSkipControls dependency property.

public static readonly DependencyProperty ShowSkipControlsProperty

Field Value

DependencyProperty

ShowStopProperty

Identifies the ShowStop dependency property.

public static readonly DependencyProperty ShowStopProperty

Field Value

DependencyProperty

ShowTimeProperty

Identifies the ShowTime dependency property.

public static readonly DependencyProperty ShowTimeProperty

Field Value

DependencyProperty

ShowTimelineProperty

Identifies the ShowTimeline dependency property.

public static readonly DependencyProperty ShowTimelineProperty

Field Value

DependencyProperty

ShowVolumeProperty

Identifies the ShowVolume dependency property.

public static readonly DependencyProperty ShowVolumeProperty

Field Value

DependencyProperty

SourcesProperty

Identifies the Sources dependency property.

public static readonly DependencyProperty SourcesProperty

Field Value

DependencyProperty

VolumeProperty

Identifies the Volume dependency property.

public static readonly DependencyProperty VolumeProperty

Field Value

DependencyProperty

Properties

AllowPlayPauseOnClick

Gets or sets a value indicating whether play and pause on click/touch is enabled.

public bool AllowPlayPauseOnClick { get; set; }

Property Value

bool

CanControlTimeline

Gets or sets a value indicating whether the timeline slider can be controlled.

public bool CanControlTimeline { get; set; }

Property Value

bool

CurrentMediaIndex

Gets the index of current media (1 to TotalMedias).

public int CurrentMediaIndex { get; }

Property Value

int

HasVideo

Gets or sets a value indicating whether the media has video.

public bool HasVideo { get; set; }

Property Value

bool

IsAutoPlay

Gets or sets a value indicating whether the media starts playing on load.

public bool IsAutoPlay { get; set; }

Property Value

bool

IsMuted

Gets or sets a value indicating whether the audio is muted.

public bool IsMuted { get; set; }

Property Value

bool

IsPaused

Gets or sets a value indicating whether the media is paused.

public bool IsPaused { get; set; }

Property Value

bool

IsPlaying

Gets or sets a value indicating whether the media is playing.

public bool IsPlaying { get; set; }

Property Value

bool

IsStoped

Gets or sets a value indicating whether the media is stopped.

public bool IsStoped { get; set; }

Property Value

bool

IsTransparentOnStop

Gets or sets a value indicating whether the video is transparent on stop (not the controls).

public bool IsTransparentOnStop { get; set; }

Property Value

bool

PlaylistItems

Gets the play list items.

public IEnumerable<string> PlaylistItems { get; }

Property Value

IEnumerable<string>

RepeatMedia

Gets or sets a value indicating whether the media is repeated at the end.

public bool RepeatMedia { get; set; }

Property Value

bool

RepeatQueue

Gets or sets a value indicating whether the playlist is repeated.

public bool RepeatQueue { get; set; }

Property Value

bool

ShowControlBar

Gets or sets a value indicating whether the control bar is shown.

public bool ShowControlBar { get; set; }

Property Value

bool

ShowPlay

Gets or sets a value indicating whether the play and stop button is shown.

public bool ShowPlay { get; set; }

Property Value

bool

ShowPlayPauseStateIcon

Gets or sets a value indicating whether the play and pause state icon is shown.

public bool ShowPlayPauseStateIcon { get; set; }

Property Value

bool

ShowPlaylist

Gets or sets a value indicating whether the playlist icon is shown.

public bool ShowPlaylist { get; set; }

Property Value

bool

ShowSkipControls

Gets or sets a value indicating whether the skip controls are shown.

public bool ShowSkipControls { get; set; }

Property Value

bool

ShowStop

Gets or sets a value indicating whether the stop button is shown.

public bool ShowStop { get; set; }

Property Value

bool

ShowTime

Gets or sets a value indicating whether the time control is shown.

public bool ShowTime { get; set; }

Property Value

bool

ShowTimeline

Gets or sets a value indicating whether the timeline control is shown.

public bool ShowTimeline { get; set; }

Property Value

bool

ShowVolume

Gets or sets a value indicating whether the volume control is shown.

public bool ShowVolume { get; set; }

Property Value

bool

Source

Gets the current media URI.

public Uri Source { get; }

Property Value

Uri

Sources

Gets or sets the uris of the media sources. Do not use embedded resources.

public IEnumerable<Uri> Sources { get; set; }

Property Value

IEnumerable<Uri>

SpeedRatio

Gets or sets the speed ratio of the media. The speed ratio of the media. The valid range is between 0 (zero) and infinity. Values less than 1 yield slower than normal playback, and values greater than 1 yield faster than normal playback. Negative values are treated as 0. The default value is 1.

public double SpeedRatio { get; set; }

Property Value

double

TotalMedias

Gets the numbers of all medias in queue.

public int TotalMedias { get; }

Property Value

int

Volume

Gets or sets the media's volume (0 to 1).

public double Volume { get; set; }

Property Value

double

Methods

InitializeComponent()

InitializeComponent

public void InitializeComponent()

JumpToNext()

Jump to next media.

public void JumpToNext()

JumpToPrevious()

Jump to previous media.

public void JumpToPrevious()

Pause()

Pauses media at the current position.

public void Pause()

Play()

Plays media from the current position.

public void Play()

Stop()

Stops and resets media to be played from the beginning.

public void Stop()

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler