Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Trying to Please Everybody

Because Netscape knew that not all Web browsers would support its non-standard <embed /> tag, it provided an easy way to include alternate content for other browsers. Immediately following an <embed /> tag, you can specify any amount of HTML code for other browsers, between the <noembed> and </noembed> tags. For example, Figure 17.3 contains the following code:

<embed src="3dtetra2.avi" autostart="true" loop="true"
   width=160 height=120 vspace=10 hspace=20 align="left" />
  <noembed>
    <a href="3dtetra2.avi">
      <img src="3dtetra.jpg" border=0
       width=160 height=120 vspace=10 hspace=20 align="left" />
    </a>
  </noembed>

Here's how this will work in various browsers:

  1. Netscape Navigator 3, 4, or 5 sees only the <embed /> tag and ignores everything between <noembed> and </noembed>. (If the Netscape LiveMedia plug-in is installed, it interprets autoplay and loop as discussed earlier.)
  2. In Netscape Navigator 2, if no AVI-compatible plug-in is installed, users may see an unsightly puzzle-piece icon and a message saying plug-in not loaded. If they click the Get the Plug-In button, they are taken to a page on Netscape Corporation's Web site that explains how to get and install plug-ins and helper apps.
  3. Microsoft Internet Explorer 3, 4, or 5 looks in the Windows file type registry for a player for the <embed /> tag. It usually finds mplayer.exe. the Windows Media Player, and embeds it into the Web page.
  4. Microsoft Internet Explorer 2, like most other older browsers, sees only the <a> and <img> tags. It displays the 3dtetra.jpg image, so that users with an AVI- compatible helper application can click the image to play the 3dtetra2.avi video clip in a separate window.
  5. Netscape Navigator version 1.2 is actually a special problem case because it recognizes the <embed /> tag, but not the <noembed> tag. It displays both the image specified in img src and an embedded OLE display or, more often, a broken image icon resulting from a failed attempt to display the <embed /> tag. Clicking the 3dtetra.jpg image still launches an AVI helper application if one is available.

To thicken the plot, some people who already have the software they need to view your embed media files may see a message announcing boldly, warning: there is a possible security hazard here. This message really means that the user has a helper application available on his system that can display the media file, and Netscape Navigator 2 or higher is about to run it. The alarmist tone of the message is very unfortunate because the likelihood of having any security risk is actually no greater than any other time a helper application is invoked or a page is displayed.

Some novice users are sure to become convinced that they must click Cancel or risk having the monitor blow up, but what you really want them to do is click Continue, so they can watch a totally harmless video clip. Unfortunately, there's really nothing you can do as a Web page author to control whether this message appears. Most people with current browser versions won't see it. However, you should still be aware of what some users may see so you can intelligently choose if and when to use the <embed /> tag, and what sort of caveats to offer along with your embedded media.

Share ThisShare This

Informit Network