开发者

How to know which video formats my WPF application can play?

开发者 https://www.devze.com 2023-01-24 12:26 出处:网络
I have a small application that allows the playback of videos. First off, I do not restrict the user to select particular types of file. What I want to do is make s开发者_开发技巧ure I can play the fi

I have a small application that allows the playback of videos. First off, I do not restrict the user to select particular types of file. What I want to do is make s开发者_开发技巧ure I can play the file the user selected. How do I get a list of available codecs, or query the playback qualities of the WPF application (the MediaElement control)?

The alternative proposed is to convert any selected input file to a uniform format (for example, MPEG) before it's played, but that seems to be more difficult.


Why don't you:

  1. Try to play it
  2. if you immediately get an error from the media element, it isn't supported.

You could always make the media element hidden while you did this. This will be much more reliable than any attempt to pre-calculate what is and isn't supported.

0

精彩评论

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