Customizing Playback

Once MediaElement’s source is set and MediaOpened is raised, the media starts playing automatically. If you don’t want it to, then set AutoPlay to false. When the user switches away from your app, any playing MediaElement automatically mutes. It then automatically unmutes once your app comes back to the foreground. The only way to change this behavior is with background audio support covered in Chapter 21.

You can set MediaElement’s IsFullWindow property to true to make it automatically occupy the entire contents of your window. In this mode, it covers all other elements and ignores any customizations to its rendering (Opacity, RenderTransform, Projection, Margin, and so on). Think of this as a full-screen mode, except that ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.