How do I know which video formats can play in my WPF application?

I have a small application that allows you to play videos. Firstly, I do not limit the user to the choice of certain types of files. I want to do this to make sure that I can play the file selected by the user. How to get a list of available codecs or request playback quality of a WPF application ( MediaElement control)?

The suggested alternative is to convert any selected input file into a single format (for example, MPEG) before playing it, but it seems more complicated.

+4
source share
2 answers

Why would you:

  • Try to play it
  • If you immediately receive an error message from the media element, it is not supported.

You can always hide the multimedia element while you do this. This will be much more reliable than any attempt to pre-calculate what is and is not supported.

+1
source

All Articles