locked
MediaElement and Windows Media Player Version RRS feed

  • Question

  • Since videos are not playing like expected (MediaElement is only displaying a white screen) on clients without WMP 11 I would like to check the currently installed WMP version.

    How can I accomplish this? Is there a way to directly detect the version or do I have to try to play some media and check for an error?

     

     

    Monday, July 9, 2007 9:46 AM

Answers

  • I haven't seen anything in the MediaElement control that lets you check the version, but I would guess that you can check a registry setting to figure it out. 

     

    This might be beyond what you want to do, but for my application, I'm including a DLL from the Media Player v9 SDK called wmppia.dll.  With this DLL, I can create a WindowsMediaPlayer object and call Player.versionInfo to get the version information.

     

    The SDK is pretty easy to use and the examples are very useful.  Here's a link to the download:  http://www.microsoft.com/downloads/details.aspx?FamilyID=e43cbe59-678a-458a-86a7-ff1716fad02f&DisplayLang=en

     

    Tuesday, July 10, 2007 3:52 AM

All replies

  • Hi,

    I am sorry that I don't have the answer to that question, but (before you start cursing me) I want to point out that the minimum version of WMP for WPF is WMP 10, not WMP 11.

    Greetings,
    Laurent
    Monday, July 9, 2007 11:33 AM
  • I would run Media Player from your Start menu and select Help - About Windows Media Player.

     

    Now getting the menu items to display might be a challenge depending on the version and skin that you have.  For v9, there is an up/down arrow pair at the top left of the application to display the menu bar.

     

    Monday, July 9, 2007 11:21 PM
  • Just to clarify: I want to detect the media player version through c# code or test the playback function for errors and act accordingly. I don't want to manually check every single client machine out there.

    I've searched for quite a while and haven't found anything, which seems odd to me.There really should be a good method to handle this. Maybe including WMP 10 (thanks Laurent) in the prerequisites window in visual studio?

    Tuesday, July 10, 2007 12:18 AM
  • I haven't seen anything in the MediaElement control that lets you check the version, but I would guess that you can check a registry setting to figure it out. 

     

    This might be beyond what you want to do, but for my application, I'm including a DLL from the Media Player v9 SDK called wmppia.dll.  With this DLL, I can create a WindowsMediaPlayer object and call Player.versionInfo to get the version information.

     

    The SDK is pretty easy to use and the examples are very useful.  Here's a link to the download:  http://www.microsoft.com/downloads/details.aspx?FamilyID=e43cbe59-678a-458a-86a7-ff1716fad02f&DisplayLang=en

     

    Tuesday, July 10, 2007 3:52 AM
  • I am doing like you suggested and am checking the registry for the installed version.

    Code Snippet


    Microsoft.Win32.RegistryKey wmpRegKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}");
    string strVersion = (string)wmpRegKey.GetValue("Version");


    Nevertheless, I am encountering another problem which leads me to believe that WMP10 is not enough for WPF since MediaElement does not play any streaming video, as described here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1857407&SiteID=1

    Tuesday, July 17, 2007 1:51 PM