Detect Media Player Version and Use

Posted on 2005-05-09
Last Modified: 2008-01-09

I have just updated a media player object and made it cross browser compatible for a friends website, but she has now said that it will not work with earlier versions of media player.  Is there a way of adapting the following code to make it detect the version of media player installed and use that?  It needs to work for IE, Netscape, Mozilla Firefox etc.  The version she said she had tried and had trouble with is media player 6.1.

Here is the code for the media player:

<td class="mplayerCell">
<object id="Player" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" width="320" height="320">
      <param name="ShowStatusBar" value="true">
      <param name="autostart" value="true">
      <param name="ShowAudioControls" value="false">
      <param name="ShowDisplay" value="false">
      <param name="ShowGotoBar" value="false">
      <param name="ShowTracker" value="false">
      <param name="ShowPositionControls" value="false">
      <param name="CaptioningID" value="capText">

<div id=mediaPlayerMozilla>
<embed type="application/x-mplayer2" pluginspage="" showControls="1" width="320" height="320"></embed>

Thanks in advance,

Question by:john-formby
    LVL 25

    Accepted Solution

    This link
    has the code to check the version of windows media player
    LVL 14

    Author Comment

    Thanks for the speedy reply.  Let me get this right, I include the following line

    <script type="text/javascript" src="sniffer2.js"></script>

    in the head section of the page and it will automatically detect which version of the media player to load when the page is loaded?  I don't need to change any of the code I posted above?


    LVL 25

    Expert Comment

    in that script u have this


    this wud return true if the windows media player version is greater than 7

    now if its not windows media player 7 and above what does ur code needs to do?>
    LVL 14

    Author Comment

    Is there anyway of getting it to work with version 6.1 of media player?  If not, or the user is using an earlier version, it needs to display a message and link saying that they need to upgrade the current version.  Is this possible?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Both jQuery and Mootools offer some nice, easy to use scripts. Mootools is best known for their interactive slideshows and jQuery for their menus, but both have many other uses as well.   jQuery is basically a toolkit with many DOM (http://en.wik…
    This article shows how to read a single webpage's HTML into a string variable, and it also shows how to automate a sequence so you can read and process a list of webpages.  I was tasked with reading and parsing a series of webpages to collect some s…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now