开发者

Add subtitles to WPF video (not Silverlight)

Just like the title says I have a wpf application with a media element and a video 开发者_StackOverflowfile with srt subtitles.

An identical question is here displaying subtitles for a video in a WPF MediaElement

but the answer is for the media element in silverlight which has a markers collection. Well, the media element from WPF doesn't have this so I'm stuck. If anyone else has other idea it will be appreciated. Thanks


You can put a TextBlock over the MediaElement, and display subtitles accordingly.

<Grid>
    <MediaElement />
    <TextBlock Name="Subtitles" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
</Grid>

However, this means you will manually have to implement the displaying of subtitles at the appropriate time. (Using the MediaElement.Position property)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜