MediaPlayerElement is automatically integrated with the system media transport controls. This layout provides more space for controls and makes the timeline easier for the user to operate. The double-row controls layout (below) is recommended for most usage scenarios, especially on larger screens. This layout is best reserved for inline media playback and compact screens.
The first example here is a single-row layout, with the play/pause button located to the left of the media timeline.
The transport controls support single- and double-row layouts. For more info, see the MediaTransportControls class reference and Create custom transport controls. You can use the transport controls as-is, or customize them in various ways. The transport controls are represented by the MediaTransportControls class. To disable them, set AreTransportControlsEnabled to false. To enable these controls, set AreTransportControlsEnabled to true. MediaPlayerElement has built in transport controls that handle play, stop, pause, volume, mute, seeking/progress, closed captions, and audio track selection. This XAML creates a MediaPlayerElement with the built in transport controls enabled and the AutoPlay property set to false. To suppress media from starting right away, you can set the AutoPlay property to false. The MediaPlayerElement begins playing when the page loads. This XAML creates a MediaPlayerElement and sets its Source property to the URI of a video file that's local to the app.
Get the XAML Controls Gallery app (Microsoft Store)Īdd media to your app by creating a MediaPlayerElement object in XAML and set the Source to a MediaSource that points to an audio or video file.If you have the XAML Controls Gallery app installed, click here to open the app and see the MediaPlayerElement or MediaPlayer in action. To display a collection of images, use a Flip view. Use a media player when you want to play audio or video in your app. All recommendations made here apply to MediaElement as well.
TOP 3 MEDIA PLAYERS WINDOWS
If you are developing an app for an earlier version of Windows 10, you need to use the MediaElement control instead. MediaPlayerElement is only available in Windows 10, version 1607 and up.