Dela via


MediaPlayer.RenderSubtitlesToSurface Method

Definition

Overloads

RenderSubtitlesToSurface(IDirect3DSurface)

Requests for the system to render the current subtitle text to the provided IDirect3DSurface.

RenderSubtitlesToSurface(IDirect3DSurface, Rect)

Requests for the system to render the current subtitle text to the specified target rectangle within the provided IDirect3DSurface.

RenderSubtitlesToSurface(IDirect3DSurface)

Requests for the system to render the current subtitle text to the provided IDirect3DSurface.

public:
 virtual bool RenderSubtitlesToSurface(IDirect3DSurface ^ destination) = RenderSubtitlesToSurface;
/// [Windows.Foundation.Metadata.Overload("RenderSubtitlesToSurface")]
bool RenderSubtitlesToSurface(IDirect3DSurface const& destination);
[Windows.Foundation.Metadata.Overload("RenderSubtitlesToSurface")]
public bool RenderSubtitlesToSurface(IDirect3DSurface destination);
function renderSubtitlesToSurface(destination)
Public Function RenderSubtitlesToSurface (destination As IDirect3DSurface) As Boolean

Parameters

destination
IDirect3DSurface

The object that implements IDirect3DSurface to which the subtitle text is rendered.

Returns

Boolean

bool

True if the system rendered subtitles to the surface; otherwise false.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

Handle the SubtitleFrameChanged event to receive a notification that the subtitle content has changed. Check the return value to see if subtitles were rendered. If the method returns false, then no subtitles were rendered. In this case you may decide to hide the subtitle render surface in your UI.

In order to use this feature, you must place the MediaPlayer into frame server mode by setting IsVideoFrameServerEnabled to true, and the playing media content must have at least one timed metadata track that has had its presentation mode set to PlatformPresented with a call to Media​Playback​Timed​Metadata​Track​List.SetPresentationMode. For more information on using MediaPlayer in frame server mode, see Play audio and video with MediaPlayer. For more information on working with metadata tracks, see Media items, playlists, and tracks.

Applies to

RenderSubtitlesToSurface(IDirect3DSurface, Rect)

Requests for the system to render the current subtitle text to the specified target rectangle within the provided IDirect3DSurface.

public:
 virtual bool RenderSubtitlesToSurface(IDirect3DSurface ^ destination, Rect targetRectangle) = RenderSubtitlesToSurface;
/// [Windows.Foundation.Metadata.Overload("RenderSubtitlesToSurfaceWithTargetRectangle")]
bool RenderSubtitlesToSurface(IDirect3DSurface const& destination, Rect const& targetRectangle);
[Windows.Foundation.Metadata.Overload("RenderSubtitlesToSurfaceWithTargetRectangle")]
public bool RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle);
function renderSubtitlesToSurface(destination, targetRectangle)
Public Function RenderSubtitlesToSurface (destination As IDirect3DSurface, targetRectangle As Rect) As Boolean

Parameters

destination
IDirect3DSurface

The object that implements IDirect3DSurface to which the subtitle text is rendered.

targetRectangle
Rect

The rectangle within the provided surface within which the subtitles are rendered.

Returns

Boolean

bool

True if the system rendered subtitles to the surface; otherwise false.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

Note that this method is less efficient than the other overload of RenderSubtitleToSurface, but it allows you to use the same surface for rendering video and subtitles rather than requiring a separate surface for subtitles.

Handle the SubtitleFrameChanged event to receive a notification that the subtitle content has changed. Check the return value to see if subtitles were rendered.

In order to use this feature, you must place the MediaPlayer into frame server mode by setting IsVideoFrameServerEnabled to true, and the playing media content must have at least one timed metadata track that has had its presentation mode set to PlatformPresented with a call to Media​Playback​Timed​Metadata​Track​List.SetPresentationMode. For more information on using MediaPlayer in frame server mode, see Play audio and video with MediaPlayer. For more information on working with metadata tracks, see Media items, playlists, and tracks.

Applies to