Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Taking_Your_Talent_to_the_Web.pdf
Скачиваний:
5
Добавлен:
11.05.2015
Размер:
9.91 Mб
Скачать

Taking Your Talent to the Web

379

As to whether anyone ever upgraded their browser in direct response to a website’s message, well, that is something else again.

The “Automagic Redirect”

Whether bundled with the browser or not, all plug-ins are readily available online. In some cases, when a web user hits a page that requires a plug-in not found on her system, Java is substituted for the missing plug-in (as in the preceding example).

In most cases, though, Java is not pressed into service. After all, plug-in manufacturers want their plug-ins to be downloaded, not synthesized by a substitute technology. Typically, when a web user lacks a plug-in, she is

“automagically” directed to the appropriate plug-in page so she can download it. In most cases, the magic is merely a matter of adding a <pluginspage> attribute to the HTML <OBJECT> or <EMBED> tag:

<embed src=”http://build.kubrick.org/sounds/the.shinning/midnight.the.stars.and.you.mp3” autostart=”true” volume=”100” width=”2” height=”2” controls=”hidden” pluginspage=”http://www.quicktime.apple.com”>

In this snippet lifted from our unfinished experiment at www.kubrick.org, the <pluginspage> attribute to the <EMBED> tag serves two functions:

1.The material in question is an MP3 audio file (midnight.the.stars. and.you.mp3), capable of being played by a number of additional plug-ins and players, including RealPlayer, Flash, and a variety of free and commercial applications. Specifying QuickTime in the <pluginspage> attribute tells the browser which plug-in to select: namely, Apple’s QuickTime plug-in. More about why that’s important a little later in this section.

2.It also provides a web address where the latest version of the QuickTime plug-in can be downloaded. If the visitor did not have QuickTime installed on her system, the browser would display a dialog box indicating that the plug-in was required and asking if she wished to download it. Clicking Yes or Okay would load the appropriate Apple plug-in page. The way the <EMBED> tag works, the browser does most of the work of supporting the web user (and the web designer).

380 HOW: Beyond Text/Pictures: Who Makes the Salad?

Embed 'n Breakfast

<embed src=”http://build.kubrick.org/sounds/the.shinning/midnight.the.stars.and.you.mp3” autostart=”true” volume=”100” width=”2” height=”2” controls=”hidden” pluginspage=”http://www.quicktime.apple.com”>

Heck, while we’ve got this markup in front of us, let’s just go ahead and explain what the rest of it means:

<EMBED>. This tells the (2.0 or higher) browser to anticipate content that must be handled by a plug-in.

<AUTOSTART>. This tells the browser to begin playing the file instantly. (The default value is on.)

<VOLUME>. This sets the loudness. (The default value is 100, or full volume.)

<CONTROLS>. This specifies the presence or absence of on-screen controllers, similar to those on a video or audio cassette console. If controls are visible, they can be seen and used by the visitor. If hidden, they do not appear, and consequently they take up no space on the screen. (The default value is visible.) When would you use hidden? You’d use it, as we have here, when you simply want the file to play without prompting the visitor to do anything. Naturally, in such a case, you’ll turn Autostart on. Otherwise, you’re forcing the user to download a file they have no means of playing.

<WIDTH>, <HEIGHT>. These attributes specify the size of an in-page controller, if any. Interesting paradox: If controls are hidden, why specify sizes at all? It’s because Netscape 2, 3, and 4 might crash if some size attribute were not included. It also could crash if the size were smaller than 2. As to the number itself, “2” means “2 pixels.” Though width and height are specified, they do not appear because the “hidden” value of the <CONTROLS> attribute makes them invisible. If you’re working with hidden player controls, the default width and height attributes should be 2 to avoid crashing old versions of Netscape Navigator.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]