Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 2.65 KB

mediaplayer_rendersubtitlestosurface_85866742.md

File metadata and controls

35 lines (25 loc) · 2.65 KB
-api-id -api-type
M:Windows.Media.Playback.MediaPlayer.RenderSubtitlesToSurface(Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface)
winrt method

Windows.Media.Playback.MediaPlayer.RenderSubtitlesToSurface

-description

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

-parameters

-param destination

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

-returns

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

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

-see-also

IDirect3DSurface MediaPlayer SubtitleFrameChanged Play audio and video with MediaPlayer Media items, playlists, and tracks

-examples