DevEdge Netscape Tools for Web Developers
Home | Archive | ViewSource | Tech Central | Library | Toolbox | Community | Site Map
 

Netscape Gecko Browsers and Plugins

Arun K. Ranganathan, Netscape Communications.  Feedback

Introduction

Netscape Gecko is a standards-based browser embedded in Netscape 6 and 7, CompuServe 7, Mozilla, and a version of AOL now in beta.

This document outlines what websites who wish to provide streaming media experiences to Gecko-based browsers can do, and also presents information for those wishing to develop Netscape-style plugins, or augment existing Netscape-style plugins.

Contents



A Definition of Terms

  • A plugin (often "plug-in") is a component that is installed into the browser application plugins directory.  It typically is a small component (on Windows, a DLL) that handles a MIME type and is built using the Netscape Plugin API by companies such as Macromedia, Real, Microsoft, and Adobe.  A plugin allows web developers to play embedded or streaming media content directly in a web browser window, and often the plugin exposes methods of its own to JavaScript (see Scriptability).  A plugin is typically invoked via special HTML tags for that purpose, such as the EMBED tag or the OBJECT tag.  
  • Scriptability is the ability of the plugin to interact with JavaScript in web pages.  This feature allows web sites to create streaming media experiences that have DHTML user interfaces to drive plugin events.  An example of this would be JavaScript-driven "Play" and "Pause" buttons in HTML, which would then allow the end user to "Play" or "Pause" active content in a plugin's area by clicking on HTML buttons.  This feature is useful for those wishing to combine DHTML, JavaScript and streaming media to create interactive user experiences.
  • A Helper Application is an application that is launched upon encountering a given media format, and "helps" enhance browser functionality by launching a specific application to play the specified content.  Typically, this is media content that is not intended to be embedded within a browser window, but is content that will exist outside the browser's context, unless the application in question is designed to always play the content inside a browser window.  An example is given below for Windows Media Player.  See also a definition of MIME types.

General Recommendations 

This document assembles some material useful to web sites wishing to deploy streaming media alongside their standard web content (DHTML, JavaScript, etc.).

If you wish to deploy streaming media, such as audio and video content, and integrate these into web pages with DHTML user-interfaces, we recommend RealPlayer because:
  1. All Netscape Gecko browsers (except the standalone Mozilla browser) on Windows ship with RealPlayer 8. This means that on Windows, when installing the latest Netscape browser, you have the choice of installing RealPlayer 8 also. 
  2. In Netscape Gecko browsers, RealPlayer 8 and RealOne support scripting between the embedded player (plugin) and web pages at this time.  This is an important feature for those who want DHTML user-interfaces (e.g. JavaScript-driven "Play" and "Pause" buttons) and in general, want scripting of media plugins.  Microsoft's Windows Media Player does not currently support scripting between the player and the Mozilla-based browser.
  3. RealPlayer supports a wide variety of codecs and media types.
All major plugins work well with Netscape Gecko.  In particular, the following plugins are now scriptable:

  1. Macromedia's latest Flash player, released in July 2002.  The scriptable versions are Flash 6 r40 and onwards.  Versions before Flash 6 r40 worked with Netscape Gecko browsers, but were not scriptable.  See the section on Flash for more information.
  2. Apple's Quicktime 6 player, which is now fully scriptable.  Quicktime 6 and onwards are scriptable in Netscape Gecko browsers, but Quicktime 5.x and before are not scriptable in Netscape Gecko browsers.  See the section on Quicktime for more information.
  3. The Viewpoint player, for 3D animation and graphics viewing.  Viewpoint's MetaStream plugin will ship with Netscape 7.0.
  4. RealPlayer 8, bundled with Netscape browsers, including Netscape 7.0 PR1 and later.  Note that RealPlayer 8 is considered a legacy product by RealNetworks.
  5. RealOne player, which is RealNetworks latest revision to their player.  This version is not bundled with Netscape browsers, but is available for download from http://www.realone.com/ .  In particular, click here to download the free RealOne player .
The following general recommendations hold true for all of the plugins mentioned in this article:
  1. Most of these plugins can be invoked with a unique MIME type that is different from the actual MIME type of the file being deployed.  This unique MIME type is called an invocation MIME type in this article, and is a MIME type determined by the plugin manufacturer.  This means that the MIME type that the type attribute refers to in both the OBJECT and the EMBED tag need not match the MIME type of the source being referred to in the data or src attributes respectively.  This is best seen with some examples for Real and Windows Media Player that are described later in this document.  Invocation MIME types are useful because they allow you to invoke a specific plugin, despite the configuration of the end-user's hard drive.
  2. It is possible to use the OBJECT tag with Netscape Gecko browsers (to be W3C compliant in HTML 4.01 and XHTML), and it is recommended that you nest your OBJECT tags for Gecko-based browsers inside the OBJECT tags for IE as shown in the example.  However, the OBJECT tag usage in Netscape Gecko browsers is subject to a few caveats:
  3. It is best to nest your EMBED tag within your OBJECT tag -- this has been the mechanism of invoking both ActiveX controls for IE and Netscape plugins for Netscape browsers ever since the release of Netscape Communicator 4.x
  4. You can use JavaScript to determine what plugins are installed in the browser, and what versions of the plugins are installed.  These techniques are mentioned in the section on QuickTime.

Popular Plugins

RealPlayer

As mentioned above, RealPlayer 8 is bundled in all Netscape Gecko browsers except the standalone Mozilla browser, and the plugin is fully exposed to JavaScript calls that Real has publicized for DHTML and JavaScript programmers: http://service.real.com/help/library/guides/extend/embed.htm

Recommendations:

  • RealPlayer 8 and RealOne support a variety of popular audio and video formats, and can be invoked to handle these as either plugins or helper applications, depending on how a user has configured their RealPlayer:
    • Audio: mp1, mp2, and mp3, ra files (RealPlayer only), wav, midi, aiff, au
    • Video: rv files (RealPlayer only), rm or ram files (RealPlayer only), mpeg, avi
Note that the invocation MIME type doesn't always reflect the MIME type of the actual resource, e.g. in the above example, although we are deploying the AVI file type, in lieu of using the affiliated MIME type, namely video/avi, we are saying audio/x-pn-realaudio-plugin.  You do not have to use an invocation mimetype, but then you have no guarantee of what plugin will ultimately be loaded in the end user's browser while viewing your web page.  Invocation MIME types provide you with more control.

Windows Media Player 

Products using Netscape Gecko do not ship with Windows Media Player. However Windows Media Player 7.0 and 7.1 function perfectly within Netscape Gecko browsers, with the exception of scriptability.  Furthermore, Windows Media Player does ship with the Windows XP Operating System, and works well as a Helper Application.  More information on Windows Media Player can be found in the DevEdge Article on Windows Media Player.

What's Supported:
  • Launch as a helper app.  Applications on your PC are configured to handle certain types of files.  If, for example, I configure Windows Media Player to handle AVI files, and then send the browser an AVI file over HTTP (e.g. by having the user click on a URL that links to an AVI file), then the user will be shown a dialog box with the following choices:
    • To open the file with avifile, a component inside Windows Media Player, OR
    • To Save the File to Disk, which is always an option in case the user wants to save the file and retrieve it later.
    • Here's an example of this: http://www.geocities.com/MotorCity/Pit/3571/martial/mikemookjong2.avi .  Clicking on this URL should spawn the helper application that is the default handler for AVI.  Chances are, it is either QuickTime, RealPlayer, or Windows Media Player.
  • Embed plugin on a web page.   Here are two ways of doing this:
    • Using OBJECT tag:   <object type="application/x-mplayer2" height="500" width="500"> <param name="src"        
      value="http://www.geocities.com/MotorCity/Pit/3571/martial/mikemookjong2.avi">
      </object>
    • Using EMBED tag: <embed type="application/x-mplayer2" height="500" width="500" height="500" src="http://www.geocities.com/MotorCity/Pit/3571/martial/mikemookjong2.avi" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/default.asp"></embed>
Note that the use of the OBJECT tag assumes that the plugin exists on the desktop, and doesn't tell you where to get it if it is missing.  The EMBED tag allows you to provide the pluginspage attribute, telling users where to obtain the plugin if it is not present. Future Netscape Gecko browsers will allow the use of the codebase attribute with the OBJECT tag as an equivalent for the pluginspage or pluginurl attributes in the EMBED tag.

Note also that in both the OBJECT tag and EMBED tag examples above, in order to force Windows Media Player to open the AVI (and not have the API handled by any other plugin), the express use of invocation MIME Types is made use of.  Similar to the RealPlayer example above, the use of the application/x-mplayer2 MIME type opens the AVI file in Windows Media Player, and this MIME type is used in lieu of the video/avi MIME type.  Additional Invocation MIME Types for Windows Media Player include:

Mime Type Description Suffixes Enabled
application/asx Media Files * Yes
video/x-ms-asf-plugin Media Files * Yes
application/x-mplayer2 Media Files * Yes
video/x-ms-asf Media Files (*.asf,*.asx) asf,asx,* Yes
video/x-ms-wm Media Files (*.wm) wm,* Yes
audio/x-ms-wma Media Files (*.wma) wma,* Yes
audio/x-ms-wax Media Files (*.wax) wax,* Yes
video/x-ms-wmv Media Files (*.wmv) wmv,* Yes
video/x-ms-wvx Media Files (*.wvx) wvx,* Yes

Note that the first three MIME Types above are not associated with any file type, but are generic MIME Types for Windows Media Player.  The player can be invoked with these MIME Types irrespective of the actual codec or suffix of the media.
What is Not Supported:
  • Scriptability of controls: Microsoft has not updated the Windows Media Player to enable JavaScripting between an embedded plugin and a web page. (We hope they will upgrade their functionality in the future.) To workaround this limitation, we recommend:
    1. Offering RealPlayer as an option.
    2. Detecting that the browser is a Netscape Gecko browser, and embedding Windows Media Player with player determined controls.  The attributes of the EMBED tag determine how to show and mask the control panel for the embedded player.  In particular, there are custom attributes that can be used to show or hide the control panel, or to determine if the content should loop.  Determine whether the vendor provides custom attributes that can accomplish the user-interface effect you are seeking, in lieu of using JavaScript.

  • AVI file handing with the video/avi MIME Type.  The Netscape-style plugin made by Windows Media Player will handle AVI MIME Types, so in order to force Windows Media Player to handle AVI, you will need to use an invocation MIME type as outlined above. 

QuickTime

QuickTime is not bundled with Netscape Gecko browsers.  Thus it's a nice alternative for Mac users, but should not be the default player if you're offering a RealPlayer option.  QuickTime's installer will recognize all Netscape Gecko-based browsers, and is available from http://www.apple.com/quicktime/ .  Unlike other plugins mentioned here, QuickTime offers users an extensive ability to control what QuickTime's Netscape-style plugin itself can handle. This means that you need not deploy content using invocation MIME types, but can use whatever the user has configured the plugin to handle.  In order to configure the QuickTime Plugin:
  • Launch the QuickTime standalone application.
  • Go to Edit | Preferences | QuickTime preferences from the menu.
  • Choose Browser plug-in from the drop down list, and click on MIME settings.
You can programmatically determine (via JavaScript) what settings the QuickTime plugin is running by querying the mimetypes array for the setting you want (navigator.mimetypes[]).  Thus, if the user adds video/avi to the list of MIME types supported by the QuickTime plugin, it will now appear in the MIME types array.

Recommendations:

  • You can deploy scriptable content if you wish, since QuickTime 6 is fully scriptable and available for download.  It is a good test bed to test against.  You can detect whether your content is running against non-scriptable versions of QuickTime by looking at the plugins array and determining the version.  Versions less than "6" are not scriptable.
  • You can offer a QuickTime option in addition to your Windows Media Player or RealPlayer options, and you can restrict users to QuickTime 6 if you wish, once again, by determining the version.

Macromedia Flash

All Netscape Gecko products, except Mozilla, ship with a version of Flash. Flash 6 r23 is bundled with Netscape 7 PR1, and Netscape 7 will bundle Flash 6 r40, which is scriptable and was released for public download on July 2002. Netscape 6 and CompuServe 7 shipped with the earlier Flash 5 version. 

Recommendations:

For the best user experience and simplest code maintenance we recommend you do not detect Flash versions unless you want users to upgrade to the latest version due to these issues:
  • Scripting Flash animation: You may wish to deploy content that scripts the Flash plugin, in which case you ought to detect the presence of Flash 6 r40 by looking at the plugins array description field.  If you are bound to using the scriptability or the FSCommands capabilities of the Flash plugin, look for Flash 6 r40 and above.  You can determine version increments as those being greater than '40' in the Flash 6 series, or greater than '6.'  The best way to keep abreast of Macromedia's "dot-releases" is to look at the Macromedia homepage.

  • Known Flash 6 / Netscape Gecko bugs:

Java

All Netscape Gecko products, except Mozilla, ship with a version of Java.  Unlike Netscape Communicator 4.x, the Java Virtual Machine integration into Netscape Gecko browsers is entirely by way of plugin architecture, and the chief vendor is Sun's JavaSoft division.  Netscape Communications no longer makes a Java Virtual Machine, and thus, Sun's JRE often has different behavior with respect to runtime.  Netscape 7 has JRE 1.4.0_01, with earlier releases, such as Netscape 6.2.1, using an earlier version of the JRE.

Recommendations and Caveats:

  • Although the APPLET element is deprecated in the current HTML DTD, you may choose to use it.  Using EMBED and OBJECT are not necessary, unless your use of OBJECT is for full XHTML validation or HTML 4.01 compliance.  You may invoke the Java Plugin using the OBJECT tag in two of the following possible ways:
    • You can use the classid attribute of the OBJECT tag: <object classid="java:MyClassName.class"....> .  This is the only classid that Netscape Gecko browsers support, since most classid attributes used with OBJECT tags in the web today refer to the UUIDs associated with IE's ActiveX controls.  Netscape Gecko does not support ActiveX.
    • You can use the type attribute to refer to a known Java MIME type: <object type="application/x-java-applet;jpi-version=1.4.0_01" data=MyClassName.class"....>
   

Additional Development Resources

Building Your Own Netscape-style Plugin

The Netscape Plugin API is a well documented and stable API that has been around since the very early days of Netscape browsers.  There have been a few architectural changes, and thus developing a plugin for both the Netscape Communicator 4.x series and for Netscape Gecko browsers is possible.  Here are the relevant caveats and reference material:

Installing Your Plugin

In general, since Netscape Gecko is an embeddable browser technology, the number of browsers based on Netscape Gecko have grown, and now includes CompuServe, Netscape 6.x and 7.0, and variants of AOL's public beta.  On Windows, using the Win32 System Registry, there's a way to locate all these browsers, and the plugins directories where they are installed.  An EXE installer or an InstallShield application ought to read the Win32 System Registry and install the DLLs to the Netscape-Gecko browsers that it interoperates with.

In addition, a robust plugin installer ought to solve the problem of first installation -- namely, what to do when the plugin software is installed first, and the browser is installed second.  The plugin should leave information on how it can be found later on.

SmartUpdate vs. XPInstall

In Netscape Communicator 4.x browsers, the preferred mechanism for installing plugins was SmartUpdate, which involved signed JAR files (rather like signed CAB files in IE) and JavaScript as the installer-language.  This delivery mechanism allowed plugins to be delivered dynamically to end-users, without necessitating a departure from the browser or without restarting the browser.  But SmartUpdate is no longer supported in Netscape Gecko-based browsers.  Instead, the technology that replaces it is XPInstall (also abbreviated as XPI and pronounced "zippy").  XPInstall is capable of doing everything SmartUpdate could do in Netscape Communicator 4.x::

The main page for XPInstall information is: DevEdge's XPInstall Guidelines article .  Here are some important caveats about XPInstall:
  • Although the CompuServe browser is based on Netscape Gecko, the CompuServe browser does not support XPInstall.  Other AOL Time Warner browsers such as Netscape 6.x and 7.0 do support XPInstall, and the AOL beta provides support for it as well.
  • Unlike SmartUpdate, XPInstall in its current iteration is not a signed technology.  There are no digital signatures affiliated with XPI packages.  Instead, the end-user is asked whether they want to download and install the package from a given URL or not.  The dialog box looks like this:Example XPI Download  

Netscape Gecko's Equivalent to ActiveX Controls

 Netscape Gecko-based browsers don't support Microsoft Internet Explorer's ActiveX controls, and in general, proprietary APIs are discouraged in favor of support of W3C Web Standards.  
For ActiveX developers, Netscape Gecko-based browsers do provide alternatives to perhaps achieve the same goals.

Equivalent Mechanisms in Netscape Gecko-based browsers

These present solutions to consider above and beyond the W3C web standards:

    • chrome:// and XUL are windowing toolkit technologies which can create compelling applications outside the context of DHTML and a webpage. Using XUL/JavaScript and jar files deployed with a suitable XPInstall, you can really enhance the features of the browser.