Chapter 6

Using Netscape Plug-Ins in Internet Explorer 3.0


CONTENTS

Microsoft wants you to use ActiveX. They want you to use Internet Explorer 3.0 and all the related tools. They want you to put ActiveX controls in your Web page. If you are a loyal Internet Explorer user, you're probably really eager to do so, too.

Microsoft isn't stupid, however. They know the trick to making Internet Explorer successful is nabbing all those Netscape Navigator users. Do you think they could do that if they didn't provide some way to hang on to all those plug-ins? Nope. Microsoft knows that. So they made sure that Internet Explorer can use any plug-ins installed on your computer, as well as any plug-ins you might want to install in the future.

Using a plug-in with Internet Explorer is very simple. In reality, you don't have to do much at all. Internet Explorer automatically detects it. You learn more about that in this chapter. For all you loyal Internet Explorer fans, this chapter also introduces you to plug-ins and shows you how to use them in your own Web pages.

What Is a Plug-In?

Plug-ins are programs that extend or add features to Netscape and Internet Explorer. These features usually appear as a small window within the Web page (embedded); but it can take over the browser's entire window (full-screen) or be altogether invisible (hidden). Web authors put tags into a Web page that cause the browser to load and use the plug-in within the page. For example, a Web author might put tags into a Web page that embeds a Shockwave video file. Your browser, when seeing this tag, would load the plug-in and insert it in the Web page with the appropriate data file. Thus, you can think of a plug-in as a program that knows how to handle embedded data files, such as images and videos, that the browser doesn't know how to handle on its own.

NOTE
You'll find several different plug-ins for each type of file. It's not important that you use a specific plug-in with a specific type of file. For example, if a Web page contains an embedded AVI video, the browser will use any plug-in associated with that type of file

In many ways, plug-ins are similar to ActiveX controls. They add features to Web pages. They are platform specific with a version for each operating system that you may want to use. There are a few differences between plug-ins and ActiveX controls. you have to download and install plug-ins yourself; whereas with ActiveX controls, the browser can automatically download and install a control when needed. Also, plug-ins primarily extend the browser. They allow the browser to handle types of data, such as videos or animations, that the browser can't handle by itself. ActiveX controls, on the other hand, are not really extensions to the browser. They are more like Java applets since their programs are distributed within a Web page.

The chapters in part III, "ActiveX Control and Plug-in Reference," describe a countless number of plug-ins that you can use with Internet Explorer. These chapters also show you how to insert these plug-ins into a Web page. The sections that follow describe some of the types of plug-ins you'll find in these chapters.

Animation

Animation plug-ins include browser extensions that play animations created by a Web author. The author usually purchases an authoring package to create the animation. The viewer, which you install on your computer, is usually free of charge or very inexpensive.

The types of animations you'll see on the Web vary. In some cases, authors use animations as a navigational tool: menus, fly-over help, and so on. Figure 6.1 shows an example of a Shockwave animation. The graphic in the middle of the page fades in when you load the Web page and each menu item in the center of the page is highlighted as you move the mouse cursor over it. In other cases, authors use animations to jazz up the Web page.

Figure 6.1 : Shockwave is one of the most popular plug-ins on the Internet.

Chapter 16, "Animation Controls," documents the plug-ins that are available. You can use the information in this chapter to download the plug-in for use with other Web pages. You can also use this information to add animation plug-ins to your own Web page.

VRML

VRML (Virtual Reality Modeling Language) allows a Web author to create virtual 3-D worlds. Then, the author distributes those worlds on a Web page. As a user, you view those VRML worlds by using a VRML plug-in. Chapter 17, "VRML Controls," describes the VRML plug-ins that you can use with Internet Explorer 3.0. You'll also find information about building and distributing your own VRML worlds in this chapter.

Conferencing

Conferencing plug-ins, such as IChat, let you hold a chat session right there in the Web browser. You'll also find conferencing plug-ins that rely on other means, however. Chapter 18, "Conferencing Controls," describes the plug-ins you can use in Internet Explorer. Figure 6.2 shows what IChat looks like in the browser window.

Figure 6.2 : Conferencing tools, such as IChat, let you conference within an environment you're already familiar with.

Database

Database plug-ins allow you to query databases over the Web. For example, you can provide hit statistics for your Web site by embedding a database plug-in in a Web page that queries a hit database.

Chapter 14, "Database Controls," describes these types of plug-ins. PowerBuilder Datawindow is a plug-in that lets the user view and navigate a database right on the Web page. Chapter 14 also describes plug-ins that are generally useful for database access, such as Citrix winFrame ICA and Dynamic Cube.

Form Elements

Form elements are data entry fields, buttons, and lists that you can use on the Web page to collect information from the user. Since a plug-in requires a data file from the Web server, you won't find any plug-ins suited to this purpose. Chapter 12, "Form Elements Controls," describes a variety of ActiveX controls you can use for user input, however.

TIP
You can submit ActiveX controls to the server as part of a form. See chapter 2, "Inserting ActiveX Controls on the Web Page," for more information.

Imaging

Internet Explorer and Netscape directly support most of the popular image formats. They support GIF, JPG, and BMP, for example. However, the Web contains a lot of image files that use formats that Internet Explorer or Netscape does not directly support. PNG (Portable Network Graphics), which is a new graphics format with features similar to GIF, comes to mind.

You can install a plug-in for those types of graphics files that extend the browser so it can display the image in the Web page. A PNG plug-in allows you to view a Web page that contains a PNG image file. When new graphics standards emerge, you will see plug-ins that support those, too.

Chapter 15, "Imaging & Portable Document Controls," describes the imaging plug-ins that you can use with Internet Explorer. This chapter also shows you how to create and distribute great graphics on your own Web pages by using these plug-ins.

Video

Video is one of the biggest uses for plug-ins you will find. There are a number of video formats on the Internet-MOV, AVI, and MPG, for example. Neither Internet Explorer nor Netscape support these video formats directly. In Netscape, you have to use a plug-in to extend the browser so it can play videos. In Internet Explorer, you can either use a plug-in or an ActiveX control for each type of video. Figure 6.3 shows what a video looks like in the browser window.

Figure 6.3 : Sometimes, you will see controls in the plug-in that let you play, pause, stop, or fast- forward the video.

Chapter 20, "Video Controls," describes the video plug-ins available for use with Internet Explorer. If you're interested in distributing videos on your own Web pages, you can get information from this chapter about creating videos and embedding them in the page.

Web Site Navigation

Plug-ins that help the user better navigate your Web site are becoming more common these days. In fact, many of the animation plug-ins, described earlier, can be used to create fancy menus and fly-over help. Other plug-ins make it possible to put menus on the Web page or create pop-up windows.

Chapter 13, "Web Navigation Controls," describes the plug-ins you can use to help your users better navigate your Web site.

Downloading and Installing Plug-Ins

The best place to get for plug-ins is Netscape's Web site (Internet Explorer users should feel guilty). Open http://www.netscape.com/comprod/products/navigator/version_2.0/plugins/index.html in your Web browser, and you'll see a list of the plug-in types available. Click one of the links to see all the plug-ins available for that category. You can also find plug-ins at BrowseWatch. Open http://www.browserwatch.com in your browser, and click the Plug-In Plaza button.

When you find a plug-in you want, download it into a temporary folder. For example, create a scratch folder on the Windows desktop and download a plug-in into it. After you install the plug-in, simply nuke the scratch folder to clean up the mess.

Once you have downloaded the file, double-click it. The file is almost always an executable file, which will either be a compressed file or a self-installing file:

TIP
You'll almost always find instructions for downloading and installing a plug-in on the Web page on which you downloaded the plug-in.

Using Plug-Ins with Internet Explorer 3.0

By now, you have to be wondering why you would install a plug-in when you can install a comparable ActiveX control. For example, you can install the Shockwave plug-in as well as the Shockwave ActiveX Control. Why not just install the control? You need the ActiveX control to view Web pages that use it. You also need the plug-in to view Web pages designed for use with Netscape.

In Netscape, if you open a Web page that uses a type of embedded file for which Netscape does not have a plug-in, Netscape will help the user locate and install that plug-in. Internet Explorer does not do this. Figure 6.4 shows you a Web page looks in Internet Explorer that contains an embedded file for which Internet Explorer cannot find a plug-in. Notice how it uses placeholders to represent the missing plug-ins.

Figure 6.4 : Internet Explorer can't find the correct plug-in, so it uses placeholders instead.

Using Plug-Ins if You Have Netscape

Netscape comes with many different plug-ins-out of the box. If Netscape is currently installed on your computer, Internet Explorer 3.0 will use those plug-ins without you having to do anything. Internet Explorer 3.0 will also use any plug-ins that you install later using Netscape. You'll typically find these plug-ins under C:\Program Files\Netscape\Navigator\Program\Plugins.

Table 6.1 describes the plug-ins you'll find after you first install Netscape Navigator 3.0. Live3D is a plug-in that knows how to display VRML worlds. QuickTime is a plug-in that places Apple QuickTime movies, a very popular video format, on the Web. LiveAudio plays a variety of sound formats, including the two most popular formats for Windows: WAV and MID. Lastly, NPAVI32 is a Netscape plug-in that plays the Windows AVI video format.

Table 6.1  Default Netscape Plug-Ins

NameDescription
Live3DDisplays VRML worlds (WRL)
QuickTimePlays QuickTime movies (MOV)
LiveAudioPlays sounds by using a variety of formats (AU, AIFF, WAVE, and MIDI)
NPAVI32Plays AVI videos (AVI)

NOTE
Netscape also installs a default plug-in that handles any embedded objects forwhich Netscape cannot locate a matching plug-in. Netscape also refers to this asa Null plug-in

Using Plug-Ins if You Don't Have Netscape

Just because you don't have Netscape, doesn't mean you can't use plug-ins with Internet Explorer. You just need to install those plug-ins in a different folder, that's all. Install them in the plugins folder, that is under the folder in which you have installed Internet Explorer. Typically, that path will be C:\Program Files\Plug!\Microsoft Internet\Plugins. Internet Explorer will then load and use the plug-ins you install when it opens a Web page that refers to them.

Inserting a Plug-In in a Web Page

When you install a Netscape plug-in, it registers itself on your computer as a program that can handle a particular type of file. For example, the CoolTalk plug-in registers itself to handle embedded files with the ICE file extension.

To use a plug-in on your Web page, you create a data file for that plug-in and embed it on the page by using the EMBED tag. When the browser opens the Web page and sees the EMBED tag, it locates the plug-in associated with that data file. Then, it launches the plug-in with the data file. Depending on how the author created the plug-in, it'll either run embedded in the Web page (for instance, LiveVideo), take over the entire browser window (such as PointCast Network), or remain hidden in the background (like LiveAudio).

Using the EMBED Tag

The EMBED tag is quite simple to use. It's not nearly as complicated as the OBJECT tag, which you learned about in Chapter 2 "Inserting ActiveX Controls on the Web Page." You don't have to worry about those nasty numbers that identify a control (clsid), for example. To embed a plug-in, you have to know three bits of information:

Armed with this information, you can embed a data file into the Web page by using the EMBED tag. This tag requires the name of the data file and the size of the area that the browser will use to display the plug-in. For example, the following tag will embed a data file called Vacation.avi with a width of 320 and a height of 200. If the user has installed the LiveAudio plug-in, Netscape will download Vacation.avi and pass it to the plug-in.


<EMBED SRC=vacation.avi WIDTH=320 HEIGHT=200>

The EMBED tag supports a few more Param tags than given in the previous example. Table 6.2 describes each tag it supports.

Table 6.2  EMBED Attributes

AttributeDescription
HEIGHT=NSpecifies the height of the plug-in's display area
NAME=TextProvides a name by which to refer to the plug-in
PALETTE=#rgb|#rgbSets the color palette for the foreground and background color
SRC=URLSpecifies the URL of the data file
UNITS=PIXELS|EN Specifies the unit of measurement you are using for HEIGHT and WIDTH. EN is half the point size
WIDTH=NSpecifies the width of the plug-in's display area

You can also use custom attributes that are specific to some plug-ins. For example, a video plug-in may need to know if it's to play-back the data file at full speed or half speed. In this case, you might add another attribute to the EMBED tag as in the following example. Note that custom attributes are specific to each plug-in; thus, you need to refer to the plug-in's documentation for more information.


<EMBED SRC=vacation.avi WIDTH=320 HEIGHT=200 PLAYBACK=FULL>

Supporting Internet Explorer 3.0 and Netscape

Netscape does not directly support ActiveX controls. You can use the NCompass Labs plug-in, as described in chapter 6, or you can support both ActiveX controls and plug-ins on your Web page. If you're using a Shockwave animation on your Web page, for example, you can insert the ActiveX control on the Web page by using the OBJECT tag. Then, you can sandwich the Shockwave plug-in between the beginning and ending OBJECT tag. Netscape users will use the plug-in, while Internet Explorer users will use the ActiveX control.

In the following example, Internet Explorer 3.0 will use the FutureSplash ActiveX control, and ignore the EMBED tag, because it supports ActiveX controls. It'll load the control indicated by the CLASSID attribute and set its parameters as defined by each PARAM tag. Since Netscape does not support ActiveX controls, it'll ignore the OBJECT and PARAM tags, while using the EMBED tag to load the FutureSplash plug-in. Notice the custom attributes, LOOP and PLAY, which are specific to the FutureSplash plug-in.


<OBJECT ID=mine CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

        CODEBASE=http://www.myserver.com/fsplash.cab

        HEIGHT=25

        WIDTH=200>

<PARAM NAME=Movie VALUE=mine.spl>

<PARAM NAME=Loop VALUE=True>

<PARAM NAME=Play VALUE=True>

<EMBED SRC=mine.spl HEIGHT=25 WIDTH=200 LOOP=TRUE PLAY=TRUE>

</OBJECT>

TIP
You can also detect the type of browser being used, and direct the user to a Web page that uses ActiveX controls or Netscape plug-ins.

NOTE
In many cases, Internet Explorer users will not get to choose between using an ActiveX control or a Netscape plug-in. Many Web sites check which browser the user is using and directs them to a Web page that uses an ActiveX control for Internet Explorer users or a plug-in for Netscape users. If the user is using Internet Explorer, Internet Explorer automatically downloads and installs the control, if it's not already present. If the user is using Netscape, Netscape helps the user locate and install the plug-in-again, if it's not already present.