C# Class WinRTXamlToolkit.AwaitableUI.MediaElementExtensions

Extension methods for awaiting MediaElement state changes.
Show file Open project: xyzzer/WinRTXamlToolkit

Public Methods

Method Description
PlayToEndAsync ( this mediaElement, Uri source ) : Task

Plays to end and waits asynchronously.

WaitForStateAsync ( this mediaElement, MediaElementState newState = null ) : Task

Waits for the MediaElement.CurrentState to change to any (default) or specific MediaElementState value.

WaitToCompleteAsync ( this mediaElement ) : Task

Waits for the MediaElement to complete playback.

Method Details

PlayToEndAsync() public static method

Plays to end and waits asynchronously.
public static PlayToEndAsync ( this mediaElement, Uri source ) : Task
mediaElement this The media element.
source System.Uri The source to play.
return Task

WaitForStateAsync() public static method

Waits for the MediaElement.CurrentState to change to any (default) or specific MediaElementState value.
public static WaitForStateAsync ( this mediaElement, MediaElementState newState = null ) : Task
mediaElement this
newState MediaElementState The MediaElementState value to wait for. Null by default causes the metod to wait for a change to any other state.
return Task

WaitToCompleteAsync() public static method

Waits for the MediaElement to complete playback.
public static WaitToCompleteAsync ( this mediaElement ) : Task
mediaElement this The media element.
return Task