Getting the Flash player version number with jQuery 2

Posted by Neil on January 21, 2008

Earlier today a collegue asked me how to retrieve the version number of the flash player that was installed in the users browser. Initially this is impossible with jQuery out of the box, but is easy but utilizing the brilliant jQuery plugins structure.To start off, you need to utilize the jQuery Flash Plugin. This plugin allows you all sorts of interaction with the Flash Player and creating and modifying flash objects on the page.So, once this is in place, include the script in your page, and then run the following code to return the version number:

  1. $(document).ready(function() {
  2. alert($.fn.flash.hasFlash.playerVersion());
  3. });

This will return you the string of the version number for flash (major.minor.revision).  Should you wish to break this apart simply split() as needed.