Accessibility

TechNote (Archived)

How to detect the presence of the Flash Player

The Macromedia Flash Player is preinstalled on many computer systems and with many browsers. This helps assure developers that users can see their sites. However, due to the wide variety of browsers, player versions and possible configurations, there are many potential situations that need to be considered in order to make the end user experience a smooth and seamless one. This is the reason that player detection is important to many Flash developers.

Note: The Macromedia Flash deployment kit is a complete Flash Player detection system that meets the needs of most developers. If you have a specific detection requirements, the methods discussed in the rest of this TechNote may prove useful. Otherwise, download and install the deployment kit.

Deciding on how to implement detection can be tricky due to the varying factors. Detection schemes run the gamut of difficulty and complexity. The purpose of this TechNote is to outline different detection strategies. Hopefully this information will help you decide what kind of detection to implement, if any.

There are a wide variety of detection schemes available. Many people have developed unique methods for their pages. While it's not possible to cover them all, the most popular ones are listed below.

Note: To see the latest Macromedia Flash Player download figures, see the Player Statistics page.

Built-in detection

Internet Explorer on Windows has two different methods of detecting when the Flash Player is needed, and automatically installing the ActiveX control.

Note: Netscape Navigator (Macintosh and Windows) and Internet Explorer (Macintosh) do not have built-in player detection.

  1. Install on Demand

    This feature is configured in the browser by choosing Tools>l Internet Options > Advanced > Browsing. When it is enabled, the browser will download ActiveX controls from Microsoft's Web site when the browser determines that the necessary control is not already installed. Microsoft hosts a Flash Player ActiveX control that is used for this purpose.

    This is a Windows and IE-specific feature; developers don't have a standard way to modify or detect this in an end user's browser.

    For more information on the Install on Demand feature, see the following pages on Microsoft's Web site:

  2. The HTML OBJECT tag, the classid and codebase attributes

    The OBJECT tag - used by Internet Explorer - contains two attributes that give specific information about what is needed to play the embedded Flash movie, the classid and codebase attributes.

    The classid attribute is a number that is a unique identifier for the necessary ActiveX control needed to view this page. The classid number for the Flash Player is:

    clsid:D27CDB6E-AE6D-11cf-96B8-444553540000

    It is automatically inserted into the HTML page by Flash's Publish Settings. Dreamweaver automatically inserts it, as well.

    The codebase attribute is the location of the Flash Player ActiveX files on the net, should they need to be downloaded. At the end of the codebase attribute is a series of numbers that indicate to the browser the exact version of the Flash Player needed to view the page:

    http://download.macromedia.com/pub/shockwave/cabs/ flash/swflash.cab#version=4,0,2,0

    The numbers "4,0,2,0" above indicate the Flash 4 Player, release version 2 is needed for this page. Upon encountering this information, the browser checks the version of the Flash Player installed. If something less than the Flash 4 player is installed, or less than release version 2, the browser will download a new Flash Player from the URL that precedes this.

    For more information on the classid and codebase attributes, see the following TechNotes:


    Note: To avoid forcing this browser to check for the Flash Player ActiveX control, it is possible to omit the OBJECT tag entirely, so that this browser will use the EMBED tag only. This will work for both Netscape and Internet Explorer, Macintosh and Windows.

Script-based detection

The automatic detection of the Flash Player is most commonly accomplished by implementing JavaScript and/or VBScript methods. These scripting languages are used to query the browser's structure and return true or false statements depending on whether or not a Flash Player is detected. Upon execution, a user can be served a Flash movie, an alternate GIF or JPEG image or an entirely different page.

The popularity of script-based detection is due in part to its cleanliness, and the fact that it is done before loading the page. By using the "Flash 3 with Image" and "Flash 4 with Image" HTML templates in Flash's Publish Settings, as well as the "Ad Banner" templates, this code is automatically inserted. Additionally, Dreamweaver can be used to create this code by attaching the "Check Plug-in" behavior.

Ease of use makes script-based detection the method of choice for most people. However, the drawbacks are significant. Some browsers and platforms cannot be detected properly with conventional script-based routines. Doing so will always indicate the user does not have Flash installed. These browsers and platforms include:

  • Internet Explorer 4.5 and earlier on the Macintosh
  • Older Macintosh computers based on 680x0 processors
  • Internet Explorer on Windows 3.1

Another potential issue to be aware of when implementing script-based detection is that some users manually disable JavaScript and/or VBScript in their browser configurations. When this method encounters such a situation, it will assume the user does not have the Flash Player installed.

If developing for a specific audience, the above exceptions may not be of concern. However, new platforms are continually being developed which support the Flash Player. As users are given more ways to connect to the Internet, configurations and compatibility issues may change rapidly.

For more information on script-based detection, see the following TechNotes:

Flash-only detection

To avoid the limitations of the above methods, another approach is to use a combination of Flash tricks and standard HTML tags to determine whether the user has the Flash Player installed. This approach will work across browser and operating system specifics, making it a universal solution. The drawback is that it must be created manually. The process is more complex than generating simple code, such as the script-based detection created by Flash's Publish Settings.

Documentation of this technique is available online - How to detect the Flash 4 Player without using JavaScript (TechNote 14086).

A good place to find out about alternative Flash and HTML-based detection schemes is the Flash online forums. To visit them, please see Flash online forums (TechNote 4149).

Some third-party Flash developer sites also have alternative detection techniques. For a list of Flash developer sites, see Web sites devoted to Flash and Flash Developers (TechNote 12046).

No detection

Serving up an HTML page with Flash content, without detection, is another choice for Flash developers. This option relies on standard browser behaviors. In some circumstances - such as in the above section on Built-in detection - the user will be prompted to autoinstall the Flash Player. In other situations, the user may be presented with a broken plug-in icon where the Flash content should be. Clicking on the icon will bring the user to the Macromedia player download page. This URL is in the HTML, as part of the EMBED tag and the PLUGINSPAGE parameter:

http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash

Experienced Web users may already be familiar with installing plug-ins, and can download the necessary Flash Player installer without specific instructions. However, due to the fact that this involves additional user configuration, there is room for error, especially with new users. Because of this, many developers do not wish to risk abandonment of their site by people who are intimidated by browser and installer conventions.

User Choice

The least sophisticated, and widely used, method of Flash detection involves creating a "gateway" page, which prompts the user to choose between viewing a page with Flash content or viewing an alternate page with non-Flash content. This is perhaps the easiest method to employ. It is not contingent on browser configurations, but does rely on the user's ability to choose the correct link. A potential drawback is that it involves a decision on the user's part. Human error should be taken into account.

To publish a page with this method, create a page with an HTML editor such as Dreamweaver, or use Flash's Publish Settings and choose the "User Choice" HTML template.

To download the latest Flash HTML templates, see Updated Flash 4 HTML templates available for download (TechNote 14147).

Additional information

There are additional techniques for determining precise Flash Player version, as well as ways of testing pages with older Flash Players.

Version detection

The methods above are used to detect whether or not the user has a Flash Player. However, with each new release of the Flash Player - major and minor - developers may desire to know the specific version of the Flash Player the user has when entering into a Flash site. This can be achieved by script detection, Flash ActionScript methods and other tricks that use Flash features native to each version of the program. Information on version detection is available in several TechNotes, listed below.

Testing a page with older players

Macromedia makes some of the older Flash Players available for testing purposes. To learn more about downloading and using them, see Archived Flash Players available for testing purposes (TechNote 14266).

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_14526
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:DB2
Informix
MySQL
Oracle
SQL Server
Sybase
MS Access

Products Affected:

flashplayer