Article

Flash Player Detection Techniques Unearthed

Page: 1 2 3 4 5 6 7 Next

We have a few options to get around this sticky issue:

  • completely ignore this and stick with client side scripting (until the population of Flash Player 6.0r65 and above grows) or
  • Deploy a Flash movie, then use our inbuilt version detection method above to check for a required version. Users of the latest Flash Player can skip version detection completely, thanks to the ‘flashvars' <param> tag, as you'll see below. Those with no Flash Player will see our descriptive content, as per our XHTML compliant markup.

Let's look again at a portion of the previous PHP code:

<?      
//check for flash!      
if(eregi("application/x-shockwave-flash", $_SERVER['HTTP_ACCEPT']))      
{      
     $hasFlashSupport=true;      
}      
     
<object      
  data="index.swf"      
  type="application/x-shockwave-flash"      
  codebase="http://<?=$_SERVER['HTTP_HOST']?>/sitepoint/flashdetection/testmovie/"      
  width="550"      
  height="400">      
        <param name="movie" value="http://<?=$_SERVER['HTTP_HOST']?>/sitepoint/flashdetection/testmovie/index.swf" />      
        <param name="menu" value="false" />      
        <param name="quality" value="high" />      
        <param name="bgcolor" value="#ededed" />      
        <?      
        if($hasFlashSupport)      
        {      
        //tell actionscript to skip the version check (we know version 6.0r65 or greater is installed)      
        //flashvars makes a variable called skipVersionCheck available on the _root timeline.      
        ?>      
         <param name="flashvars" value="&skipVersionCheck=true" />      
        <?      
        }      
        ?>      
          <p>      
          Alternate descriptive content can go here, plus a link to the Flash Player download page for the user to optionally activate.      
          <br />      
          This text will be displayed if the user-agent cannot render the Flash file specified in the object tag.      
          </p>      
     
  </object>      
     
?>

That flashvars param tag is very important, as we can use server side detection with inbuilt version detection. If we want to skip the inbuilt version detection completely we can check for the value of _root.skipVersionCheck in ActionScript.

When should this method be employed?

  • Where you want to show this detection method to a developer audience.
  • When you want to deploy a Flash movie for the latest Player -- with the next generation of Flash Players (7 and beyond), this method will be of key importance for those wanting to distinguish player versions, e.g. movies for Flash Player 7 and up only.
  • When you aren't that concerned about your Flash movie possibly breaking for Flash 2, 3 and 4 users.
  • When you want a quick and easy Flash Player 6 detection implementation that can be used for any number of Flash movies in a site (that $hasFlashSupport variable can be used throughout the script environment or even attached to a session variable).

When should this method be avoided?

  • When you want to deploy Flash content for a general audience.
  • It can't be used if you do not have access to server side scripting languages.
  • When you may have a large number of Flash Player 2 and 3 users (unlikely).

Server side detection is definitely the way of the future, and it's up to you to make the decision on whether to employ it now. Hopefully, browsers such as Internet Explorer and Opera will support this far better in the future.

Best Options for Different Situations

After running through these options, you may be wondering what the best detection scenario is for your site. Outlined below are two lists, based on reaching the widest possible audience and ease of implementation.

Detection methods that will reach the widest possible audience:

  1. Client Side Detection
  2. Inbuilt version detection
  3. Server side detection
  4. Manyana method
  5. Nested HTML tags

Detection methods that are the easiest to employ:

  1. Server side detection (including Inbuilt version detection)
  2. Inbuilt version detection
  3. Manyana method
  4. Client side detection
  5. Nested HTML tags

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links