0

Just like the title says I have a wpf application with a media element and a video file 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

Community
  • 1
  • 1
Nial
  • 321
  • 1
  • 5
  • 13

1 Answers1

0

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)

Bas
  • 26,772
  • 8
  • 53
  • 86
  • Thanks for the answer, well this is what I was hoping not do to, to syncronize manually. It's funny how most of the silverlight controls are poorer than their siblings in WPF, except the media element which is the opossite – Nial Aug 06 '11 at 09:03