title: How to know if WPF MediaElement is actually playing a video?
body: <p>I'm developing a WPF based application that must play some videos during its execution. To do this I was using the <code>MediaElement</code> class, however just after I made the first tests with my application, I discovered that some of the videos that I am trying to play are not supported by the Media Element class because I am missing the right codec. After the missing codecs were installed everything worked fine.</p>
  
  <p>The problem is that my customer's machines can also be missing codecs, in that case I would like to display some kind of message saying that a codec is missing so that this problem can be solved quickly, however when I was looking at the <code>MediaElement</code> class I didn't find any property which states why a given video is not playing. Actually from what I've seen the <code>MediaElement</code> doesn't even throw an exception when the video that it's trying to play is not on the right format, nor does it has a state variable saying that it is or is not playing a video.</p>
  
  <p>Therefore I would like to know if there is any way to discover programmatically at runtime if a given video can or cannot be played by the <code>MediaElement</code>.</p>