-api-id | -api-type |
---|---|
M:Windows.Media.Playback.MediaPlayer.GetSurface(Windows.UI.Composition.Compositor) |
winrt method |
Gets a MediaPlayerSurface object for the MediaPlayer, which allows you to render the player's contents using a Compositor without relying on the XAML framework.
The Compositor with which the returned surface will be used.
The media player surface.
By default, the CompositionSurface generated by this method will have the dimensions 640x 480, in pixels. To get a different size, call SetSurfaceSize before calling GetSurface.
You can obtain multiple surfaces from a single MediaPlayer instance by calling GetSurface multiple times.
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.