Playing and previewing audio and video (XAML)
[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]
This section contains topics on playing audio and video in your Windows Runtime app using C++, C#, or Visual Basic.
It covers how to play audio and video using the MediaElement class, share or stream media with Play To, and use effects and custom media extensions.
The control to play audio and video media is MediaElement. This is defined in the Windows.UI.Xaml.Controls namespace. The majority of the API to playback media are in Windows.Media, Windows.Media.MediaProperties, Windows.Media.PlayTo, and Windows.Media.Transcoding.
For samples that use audio and video in a Windows Runtime app using C++, C#, or Visual Basic, see the XAML media playback sample and the other samples listed in the Samples section in the Related topics below.
To see many of features in action as part of a complete media-playback sample, see Media playback, start to finish.
In this section
Topic | Description |
---|---|
Play audio and video media using a MediaElement in your Windows Runtime app using C++, C#, or Visual Basic. |
|
Create custom transport controls for a MediaElement to control and manage audio and video media playback in a Windows Runtime app using C++, C#, or Visual Basic. |
|
How to open local media files using the FileOpenPicker control |
Set the media source of a MediaElement to a local audio or video file stream opened with the FileOpenPicker control. |
Use MediaElement.AudioStreamIndex and MediaElement.GetAudioStreamLanguage to change the audio to a different language track on a video. |
|
Setting the RealTimePlayback property on a MediaElement enables low-latency playback. |
|
Learn how to keep the display on while playing back local or streaming video by using the DisplayRequest class. |
|
To play audio in the background, declare the Audio background task and handle the SystemMediaTransportControls buttons. |
|
You can write apps for Windows Phone 8.1 that play audio in the background. This means that even after the user has left your app by pressing the Back button or the Start button on their device, your app can continue to play audio. This article discusses the components of a background audio app and how they work together. |
|
The SystemMediaTransportControls class enables your app to use the system media transport controls provided by Windows and update the media info that is displayed. |
|
Use MediaElement.IsFullWindow to enable and disable full window video rendering in a Windows Runtime app using C++, C#, or Visual Basic. |
|
Set the media source of a MediaElement to an audio or video file on the network. |
|
Use MediaElement.Stretch to change how the video content fills the container it is in. This resizes and stretchs the video depending on the Stretch value. |
|
Play To enables users to easily stream audio, video, or images from their computer to networked devices. |
Related topics
Roadmaps
Roadmap for Windows Runtime apps using C# and Visual Basic
Roadmap for Windows Runtime apps using C++
Samples
Media playback, start to finish
Reference
Other resources