Detecting Plugin Versions

 


How to detect the presence of the Flash Player

Product: Flash
Platform: All
Versions: 4.0 and above
ID: 14526

 
Thank you! If this TechNote did not meet your needs, please try Power Search, our online forums, or our Support Center for more options. You can also submit feature requests for product enhancements.

 

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.

> Built-in detection
> Script-based detection
> Flash-only detection
> No detection
>

User choice

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 > 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:

Description of the "Install on Demand" and "Automatically Check for Updates" Features Installable Components in Internet Explorer

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:
> What effect does the version have in the codebase attribute of the OBJECT tag? (TechNote 12685)
> Flash OBJECT and EMBED Tag Attributes (TechNote 12701)
>

Why Does IE Install Components When a Site Uses Flash Player? (TechNote 4156)

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 and Internet Explorer Issues on the Macintosh Platform (TechNote 13638)
> Redirecting the Microsoft Internet Explorer browser for Macintosh (TechNote 13765)
> Updated Flash 4 HTML templates available for download (TechNote 14147)
>

A comprehensive list of supported Flash features, specific to each browser (TechNote 14159)

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.

> How can I detect whether a movie is playing in the Flash 4 Player? (TechNote 14126)
> JavaScript code for Flash 3 does not detect the new Flash Player 4.0 (TechNote 13893)
>

How to use the $version variable to determine Flash Player version (TechNote 14294)

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).

 

 

 

 

 

 

 



Last updated: June 19, 2001
Keywords: detection, IE, Netscape Navigator, Internet Explorer, browser, Flash Player, plug-in, ActiveX control, can't see, HTML, JavaScript, VBScript
Created: May 26, 2000
©1995-2002 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy


 


What effect does the version have in the codebase attribute of the OBJECT tag?

Product: Flash
Platform: All
Versions: all
ID: 12685
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Microsoft Internet Explorer versions 3.0 and later use the CODEBASE attribute to detect which version of the Macromedia Flash Player ActiveX Control is installed on a user's computer. If the user's version is earlier than the version specified by CODEBASE Internet Explorer can automatically download and install the newer version of the Macromedia Flash Player from the location specified in CODEBASE.

This is done by changing the version number at the end of the CODEBASE tag where '1,1,0,0' is the minimum version of the player needed to display the SWF properly. Consider the following code:

codebase="http://download.macromedia.com/pub/shockwave
  /cabs/flash/swflash.cab#version=6,0,40,0"

The numbers '6,0,40,0' specify which version of the control is required. The first number '6' tells Internet Explorer what the major version number of the Macromedia Flash Player should be and the third number '40' specifies the minor revision of the Flash Player required to correctly view the Flash content on the page.

In most cases the best practice is to specify the latest version of the Flash Player ActiveX Control. This guarantees that viewers can see all of the features in the SWF. The latest version of the control will work with movies created using earlier features. However, attempting to view newer SWF files with an older version of the player may cause problems when newer features of the player are encountered during playback.

The following table shows what happens when viewers hit a URL with various versions specified in the codebase (some scenarios reflect a player update):
Version specified by the codebase of the URL

Version of the control on the viewer's machine

change to viewer's machine
BEFORE
visiting the URL
AFTER
visiting the URL
6,0,40,0 none 6,0,40,0 latest version of control obtained from Macromedia Site
5,0,42,0
(or earlier)
6,0,40,0 latest version of control obtained from Macromedia Site
6,0,23,0 6,0,40,0 latest version of control obtained from Macromedia Site
6,0,40,0 6,0,40,0 no change
6,0,0,0

none

6,0,40,0 latest version of control obtained from Macromedia Site
5,0,30,0 6,0,40,0 latest version of control obtained from Macromedia Site
6,0,0,0 6,0,0,0 no change
6,0,23,0 6,0,23,0 no change

Note: Using '6,0,0,0' is not recommend. As shown above, if the original shipping version of the Macromedia Flash Player ActiveX Control is installed (6,0,21,0) using '6,0,0,0' as the codebase will not update the Player to the latest version.

Additional information
The latest version of the Macromedia Flash Player is available from the Macromedia Flash Player Download Center.



Last updated: July 19, 2002
Keywords: cab file, cab, version, control, codebase, IE, explorer, activex, OBJECT
Created: November 11, 1997
©1995-2002 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy


 

Flash OBJECT and EMBED Tag Attributes

Product: Flash
Platform: All
Versions: all
ID: 12701
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

This document lists the required and optional attributes of the OBJECT and EMBED tags used to publish Flash movies. For specific usage information for these attributes refer to Flash OBJECT and EMBED Tag syntax (TechNote 4150) or the "Publishing and Exporting" section of the Using Flash manual for more information on publishing Flash movies.

Required attributes:
> WIDTH - Specifies the width of the movie in either pixels or percentage of browser window.
>

HEIGHT - Specifies the height of the movie in either pixels or percentage of browser window.

>

SRC - Specifies the location (URL) of the movie to be loaded. EMBED only.

>

PLUGINSPAGE - Identifies the location of the Flash Player plug-in so that the user can download it if it is not already installed. EMBED only. (See example code in TechNote 4150 for the correct value for this attribute.)

>

MOVIE - Identifies the location (URL) of the Flash Player ActiveX control so that the browser can automatically download it if it is not already installed. OBJECT only.

>

CLASSID - Identifies the ActiveX control for the browser. (See example code in TechNote 4150 for the correct value for this attribute.) OBJECT only.

>

CODEBASE - Identifies the location of the Flash Player ActiveX control so that the browser can automatically download it if it is not already installed. OBJECT only. (See example code in TechNote 4150 for the correct value for this attribute.)

Optional attributes and possible values:
>

NAME - Identifies the Flash movie to the host environment (a Web browser, typically) so that it can be referenced using a scripting language such as JavaScript or VBScript. EMBED specific.

For more information on scripting with Flash see Scripting with Flash.

> ID - Identifies the Flash movie to the host environment (a Web browser, for example) so that it can be referenced using a scripting language. OBJECT specific.

For more information on scripting with Flash see Scripting with Flash.

> SWLIVECONNECT - (true, false) Specifies whether the browser should start Java when loading the Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same page, Java must be running for the FSCommand to work.
> PLAY - (true, false) Specifies whether the movie begins playing immediately on loading in the browser. The default value is true if this attribute is omitted.
>

LOOP - (true, false) Specifies whether the movie repeats indefinitely or stops when it reaches the last frame. The default value is true if this attribute is omitted.

>

QUALITY - (low, high, autolow, autohigh, best )
Low favors playback speed over appearance and never uses anti-aliasing.
Autolow emphasizes speed at first but improves appearance whenever possible. Playback begins with anti-aliasing turned off. If the Flash Player detects that the processor can handle it, anti-aliasing is turned on.
Autohigh emphasizes playback speed and appearance equally at first but sacrifices appearance for playback speed if necessary. Playback begins with anti-aliasing turned on. If the actual frame rate drops below the specified frame rate, anti-aliasing is turned off to improve playback speed. Use this setting to emulate the View > Antialias setting in Flash.
Medium applies some anti-aliasing and does not smooth bitmaps. It produces a better quality than the Low setting, but lower quality than the High setting.
High favors appearance over playback speed and always applies anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie has animation, bitmaps are not smoothed.
Best provides the best display quality and does not consider playback speed. All output is anti-aliased and all bitmaps are smoothed.

>

BGCOLOR - (#RRGGBB, hexadecimal RGB value) Specifies the background color of the movie. Use this attribute to override the background color setting specified in the Flash file. This attribute does not affect the background color of the HTML page.

>

SCALE - (showall, noborder, exact fit)
Default (Show all) makes the entire movie visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders may appear on two sides of the movie.
No Border scales the movie to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the movie.
Exact Fit makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur.

>

ALIGN - (l, t, r, b)
Default centers the movie in the browser window and crops edges if the browser window is smaller than the movie.
Left, Right, Top, and Bottom align the movie along the corresponding edge of the browser window and crop the remaining three sides as needed.

>

SALIGN - (l, t, r, b, tl, tr, bl, br)
L, R, T, and B align the movie along the left, right, top or bottom edge, respectively, of the browser window and crop the remaining three sides as needed.
TL and TR align the movie to the top left and top right corner, respectively, of the browser window and crop the bottom and remaining right or left side as needed.
BL and BR align the movie to the bottom left and bottom right corner, respectively, of the browser window and crop the top and remaining right or left side as needed.

>

BASE - ( . or base directory or URL) Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.

>

MENU (true, false)
True displays the full menu, allowing the user a variety of options to enhance or control playback.
False displays a menu that contains only the About Flash option.

Note: Values in italics indicate that the developer chooses the value.



Last updated: June 19, 2001
Keywords: object, embed, html, tag, code, value, attribute, tags, attributes, param, parameter, play, loop, quality, bgcolor, scale, salign, base, menu, width, height, src, pluginspage, movie, classid, codebase, background color, back ground color
Created: November 14, 1997
©1995-2002 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy


 

Detecting Flash Player version information with $version

Product: Flash
Platform: All
Versions: 4.0
ID: 14294
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Introduction
As Macromedia Flash Player updates are released, Player version information becomes important to ensure proper movie playback. For example, the ability to print directly from Flash was first introduced in Player version 4.0r20 (major version: 4, minor version: 20); before attempting to print it's a good idea to first determine if the Player supports that feature. This document discusses how to detect major and minor version of the Flash Player using ActionScript.

Determining version information
In Flash Player 4.0r11 and later Player version information is contained in a "hidden" variable called
$version. This special variable, when evaluated, returns Player version information in string form. Flash 5 introduced a new function, getVersion(), that evaluates $version automatically and returns the result.

In Flash 4 the eval function is used to extract the information in $version, as in the following code example:

Set Variable: "playerVersion" = eval("$version")

The getVersion() method in Flash 5 makes this a bit simpler, as you don't have to use eval:

var playerVersion = getVersion();

In both cases, the version information is returned as a string in the following format:

MAC 5,0,41,0
WIN 5,0,30,0
UNIX 4,0,12,0

The string consists of an abbreviation for the platform, followed by numbers indicating player version number (major version, zero, minor version, zero).

In pre-4.0r11 releases of the Flash Player no version information is returned by these methods.

A basic detection script
The following script can be used to determine major and minor Player version within Flash Player 4.0r11 and later.

Note: This script cannot be used to detect the presence of the Flash Player, but only to determine version information of an installed Player (4.0r11 or later). The Flash Deployment Kit provides a complete framework for script-based detection of Flash Player. How to detect the presence of the Flash Player (TechNote 14526) discusses some other detection techniques.

To use, copy and paste the code into the first frame of a new Flash 5 movie. Replace the commented sections (within the If statements) with commands that either re-direct to alternate content or alert the user that they need to upgrade their Player, for instance.

Export the file as a version 4 SWF file, to ensure compatibility with that version of the Player.

playerVersion = eval("$version"); 
myLength = length(playerVersion);
while (i<=myLength) {
 i = i+1; 
 temp = substring(playerVersion, i, 1); 
 if (temp eq " ") { 
  platform = substring(playerVersion, 1, i-1); 
  majorVersion = substring(playerVersion, i+1, 1);
  secondHalf = substring(playerVersion, i+1, myLength-i);
  minorVersion = substring(secondHalf, 5, 2);
 } 
} 

// Here are some example statements to determine 
// specific major/minor version information.

if (majorVersion >= 4) {
 // Player version is 4.0r11 or later.
 if ((majorVersion >=4) && (minorVersion >=20)) {
  // Player version 4.0r20 supports printing.
 }
 if ((majorVersion >=5) && (minorVersion >=41)) {
  // Player versions 5.0r41 and 42 are latest releases (as of January 2000)
 }
} else {
 // This traps for Players that are version 4.0r11 or earlier.
}

To test these expressions, preview the Flash movie in a browser by choosing File > Preview in Browser. To test the detection script against older versions of the Flash Player see Archived Macromedia Flash Players available for testing purposes (TechNote 14266).

Last updated: June 19, 2001
Keywords: version, $version, Flash Player, detection, printing, ActionScript, scripting, variable
Created: February 10, 2000

©1995-2002 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy


 

How useful was this document?  
(Less) 1 2 3 4 5 (More)
How can the document be improved? (300 characters max feedback only - you will not receive a reply.)
Product: Flash Platform: Win Versions: all ID: 4156

Why Does IE Install Components When a Site Uses Flash Player?

Question
Why does Internet Explorer 'install components' when a Web site uses Flash Player?

Answer
Internet Explorer 3.0 can automatically install a new version of the Flash Player if the version installed on your computer is out of date. This is done by adding "#version=1,1,0,0" to the end of the CODEBASE tag where 1,1,0,0 is the minimum version of the player needed to display the page properly.

Unfortunately with Internet Explorer 3.0, if a page using Flash Player has already been viewed in the browser, the upgrade process will fail and Explorer will try again to download and install the player if the page is reloaded.
Internet Explorer will download and say it is installing the new version but will leave the old version in place.

Note: To avoid this problem close all Internet Explorer windows, reopen Internet Explorer and go directly to the page that will upgrade the ActiveX control.

 

 

 
Keywords: ActiveX, installation, install components, Internet Explorer, MSIE, IE, browser, control, minimum version
Last updated: January 27, 1999
Author: Brian Payne
Area: Troubleshooting

©1995-2002 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy