
Our examples in this article so far has just used the same size for the MediaElement, not taking the dimensions of the video into consideration. Information can be found at this website) in your WPF application. I want to show you just how easy you can show video content in your WPF application, so here's a bare minimum example: Īnd that's it - a single line of XAML inside your window and you're displaying video (this specific video is about the Hubble Space Telescope - more The MediaElement acts as a wrapper around MediaPlayer, so that you can display video content at a given place in your application, and because of that, itĬan play both audio and video files, although the visual representation doesn't really matter in dealing with audio files.

This is where the MediaElement comes into play. Wrapper element to visually represent the MediaPlayer instance.

However, since a video actually needs to be displayed somewhere in the interface, as opposed to an audio file, we need a In the previous article, we used the MediaPlayer class to play an MP3 file, but the cool part about the MediaPlayer class is that it can
