Developing an application that presents a movie is really easy due to the availability of a dedicated control with a set of useful methods, as you will see in this recipe.
Place the Movie.mp4
file in the Assets
directory and add the MediaElement
control to the page by modifying the content of the MainPage.xaml
file as follows:
<Page (...)>
<Grid>
<MediaElement
Source="/Assets/Movie.mp4"
Stretch="UniformToFill"
AutoPlay="True"
AreTransportControlsEnabled="True"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</Page>