Media Playback | The recommended way of playing back media in an app is to use the [**MediaPlayer**](/uwp/api/Windows.Media.Playback.MediaPlayer) class, using the lightweight [**MediaPlayerElement**](/uwp/api/Windows.UI.Xaml.Controls.MediaPlayerElement) class to render media in XAML if desired. Improvements to the **MediaPlayer** class include the ability to play audio to a specific endpoint, the introduction of the [**MediaPlaybackSession**](/uwp/api/Windows.Media.Playback.MediaPlaybackSession) class for managing player state, pinch and zoom for video, the ability to render video to a [**Windows.UI.Composition**](/uwp/api/Windows.UI.Composition) surface, and the [**MediaTimelineController**](/uwp/api/Windows.Media.MediaTimelineController) class for synchronizing playback of multiple media players.<br>When opening media items using [**MediaSource**](/uwp/api/Windows.Media.Core.MediaSource), you can now detect media failures due fully or partially unsupported codecs.<br><br>The new [**MediaBreakManager**](/uwp/api/Windows.Media.Playback.MediaBreakManager) class to quickly and easy add media breaks to any [**MediaPlaybackItem**](/uwp/api/Windows.Media.Playback.MediaPlaybackItem) class allows you to easily create, schedule, and manage media breaks such as audio and video ads.<br><br>The **MediaPlayer** class now gets automatic integration into the System Media Transport Controls (SMTC). The new [**MediaPlaybackCommandManager**](/uwp/api/Windows.Media.Playback.MediaPlaybackCommandManager) class allows you to partially or completely override SMTC commands.<br><br>You can now play media in the background using the new one-process model, which is much simpler and easier to implement than the previous two-process model. A new manifest capability lets you tell the system that your app needs to play media in the background, and new app lifecycle events, [**EnteredBackground**](/uwp/api/windows.applicationmodel.core.coreapplication.enteredbackground) and [**LeavingBackground**](/uwp/api/windows.applicationmodel.core.coreapplication.leavingbackground), give you an opportunity to free up unused resources while running in the background.
0 commit comments