-->
New Improved Version: After signing up for Spotify Premium, I decided I needed an easy way to start and stop song.
The following example shows how to control playback of media using a MediaElement. The example creates a simple media player that allows you to play, pause, stop, and skip back and forth in the media as well as adjust the volume and speed ratio.
Example
The code below creates the UI.
Note
The LoadedBehavior property of MediaElement must be set to
Manual
in order to be able to interactively stop, pause, and play the media.Example
The code below implements the functionality of the sample UI controls. The Play, Pause, and Stop methods are used to respectively play, pause and stop the media. Changing the Position property of the MediaElement allows you to skip around in the media. Finally, the Volume and SpeedRatio properties are used to adjust the volume and playback speed of the media.