MediaPlayer.GetSurface(Compositor) MediaPlayer.GetSurface(Compositor) MediaPlayer.GetSurface(Compositor) MediaPlayer.GetSurface(Compositor) MediaPlayer.GetSurface(Compositor) Method

Definition

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.

public : MediaPlayerSurface GetSurface(Compositor compositor)
MediaPlayerSurface GetSurface(Compositor compositor) const;
public MediaPlayerSurface GetSurface(Compositor compositor)
Public Function GetSurface(compositor As Compositor) As MediaPlayerSurface
var mediaPlayerSurface = mediaPlayer.getSurface(compositor);

Parameters

compositor
Compositor Compositor Compositor

The Compositor with which the returned surface will be used.

Returns

Additional features and requirements

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

Remarks

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 MediaPlayer 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.

See also