MediaPlayerSurface MediaPlayerSurface MediaPlayerSurface MediaPlayerSurface Class


Provides access to a ICompositionSurface that is shared between a MediaPlayer and a Compositor to enable the rendering of MediaPlayer content using the Windows.UI.Composition APIs without requiring the use of the XAML framework.

public : sealed class MediaPlayerSurface : IClosable
struct winrt::Windows::Media::Playback::MediaPlayerSurface : IClosable
public sealed class MediaPlayerSurface : IDisposable
Public NotInheritable Class MediaPlayerSurface Implements IDisposable

Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)


Get an instance of this class by calling MediaPlayer.GetSurface.

For more information on using the Windows.UI.Composition APIs to render visuals, see Visual layer.

For how-to guidance for rendering video to a composition surface, see Play audio and video with MediaPlayer.


CompositionSurface CompositionSurface CompositionSurface CompositionSurface

Gets the ICompositionSurface for rendering MediaPlayer content.

Compositor Compositor Compositor Compositor

Gets the Compositor with which the surface will be used.

MediaPlayer MediaPlayer MediaPlayer MediaPlayer

Gets the MediaPlayer associated with the MediaPlayerSurface.


Close() Close() Close() Close()

Closes the MediaPlayerSurface and disposes of associated resources.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

See also