Delen via


MediaPlayer.SubtitleFrameChanged Event

Definition

Occurs when the current subtitle content has changed while the MediaPlayer is in frame server mode.

// Register
event_token SubtitleFrameChanged(TypedEventHandler<MediaPlayer, IInspectable const&> const& handler) const;

// Revoke with event_token
void SubtitleFrameChanged(event_token const* cookie) const;

// Revoke with event_revoker
MediaPlayer::SubtitleFrameChanged_revoker SubtitleFrameChanged(auto_revoke_t, TypedEventHandler<MediaPlayer, IInspectable const&> const& handler) const;
public event TypedEventHandler<MediaPlayer,object> SubtitleFrameChanged;
function onSubtitleFrameChanged(eventArgs) { /* Your code */ }
mediaPlayer.addEventListener("subtitleframechanged", onSubtitleFrameChanged);
mediaPlayer.removeEventListener("subtitleframechanged", onSubtitleFrameChanged);
- or -
mediaPlayer.onsubtitleframechanged = onSubtitleFrameChanged;
Public Custom Event SubtitleFrameChanged As TypedEventHandler(Of MediaPlayer, Object) 

Event Type

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

In the handler for this event, you can call one of the overloads of RenderSubtitlesToSurface to request that the system render the current subtitles to the provided IDirect3DSurface. If this method returns false, then no subtitles were rendered. In this case, you may choose to hide the subtitle render surface until the next time the event is raised.

In order for this event to be raised, 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