MediaPlayer.RenderSubtitlesToSurface MediaPlayer.RenderSubtitlesToSurface MediaPlayer.RenderSubtitlesToSurface MediaPlayer.RenderSubtitlesToSurface MediaPlayer.RenderSubtitlesToSurface Method

Definition

Overloads

RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface)

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

RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect)

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

RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface) RenderSubtitlesToSurface(IDirect3DSurface)

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

public : Platform::Boolean RenderSubtitlesToSurface(IDirect3DSurface destination)
bool RenderSubtitlesToSurface(IDirect3DSurface destination) const;
public bool RenderSubtitlesToSurface(IDirect3DSurface destination)
Public Function RenderSubtitlesToSurface(destination As IDirect3DSurface) As bool
var bool = mediaPlayer.renderSubtitlesToSurface(destination);

Parameters

destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface

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

Returns

bool bool bool

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

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

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.

RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect) RenderSubtitlesToSurface(IDirect3DSurface, Rect)

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

public : Platform::Boolean RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle)
bool RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle) const;
public bool RenderSubtitlesToSurface(IDirect3DSurface destination, Rect targetRectangle)
Public Function RenderSubtitlesToSurface(destination As IDirect3DSurface, targetRectangle As Rect) As bool
var bool = mediaPlayer.renderSubtitlesToSurface(destination, targetRectangle);

Parameters

destination
IDirect3DSurface IDirect3DSurface IDirect3DSurface

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

targetRectangle
Rect Rect Rect

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

Returns

bool bool bool

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

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

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.