Reputation: 14423
1.There are some file formats (suppose a real audio file? (.ra)) which VLC can play butWindows Media Player (Default) can't. How can I find out if there is a player in the system that can play the file format I want?
2.Additionally, is there a way to embed such a player in my (C#) application in a generic way?
Upvotes: 0
Views: 106
Reputation: 1899
It is a bit complicated but I can give you a start point (the code would be a bit too long to write it now), so here is what I think.
You just go and search in the
HKEY_CLASSES_ROOT
hive for the extension of the file (in your case it will be .ra). If you find such key, you will either have a subkeys that will help you determine what software has been used to open them or using the "Content Type" string value, you perform another search in the HKEY_CLASSES_ROOT where you will again have keys that will say what software opens this kind of content.
So you need to use the classes that deal with the Registry (asuming you want to do this programatically).
About your second question: I don't think there is a generic way to embed any player in your application. It's because not every player will provide some API to attach to, you won't have a contract to rely on and a lot of other problems. You may have some success with the Windows API but I doubt it will cover all the scenarios you will end up having to support.
You have few choices here:
Upvotes: 2