Lesson 8 : Multimedia Add-ons


Another way to enhance the appeal of your website without having to enhance the content is sound and video.  There are many types of streaming media available today as well as the traditional formats.  Most add-ons of this type take a while to load so you might not want to blanket your site with them.

You can place a sound on your page that plays as soon as it is loaded.  A background sound can be a .wav but a midi is recommended in order to reduce the size.  If your system is set up right, you probably heard a song play once shortly after entering this page.  To do this, just put the code <bgsound src = "prtytime.mid" loop="0"> somewhere between the <head> tags.  You can refer to any sound on the web or your computer with "src" and determine the number of times the sound will repeat itself with "loop."  To repeat an infinite number of times, type in "-1"; it is not recommended, however, to play a song more than three or four times so as to avoid causing insanity.

Video can be an entertaining addition to a web page and can be attached in such forms as .avi, .qt4, and .gif.  These should be very small and brief if you want your page to run smoothly on a normal connection.  To insert a video clip, use the tag <img border = "0" dynsrc="goeye.avi" start = "mouseover" loop="0"> The file next to the "dynsrc" command can be at any location, the start is set to either "fileopen" if you want the movie to play when it is first loaded, or "mouseover" if you want it to be played whenever someone moves the mouse over it.  Height and width commands can be added if necessary; these and the border command work exactly as they do with normal pictures.  The loop code may be set from 0 to -1(or infinite) or you can place the power in the hands of the user and type in the word "controls" somewhere within the tag; this places play, stop and other buttons under the movie.

It is also possible to put sounds, movies or any other kind of file on a page to be downloaded.  Just use the format for hyperlinks <a href = "ding.wav">Ding</a>

Click Here The browser will ask whether the user wants to save or open it, to hear or use a file immediately, click on open, otherwise, click on save to put it on your hard drive for future use.

Streaming is the newest approach to displaying multimedia online.  It works by downloading the song or movie while you play it, so the wait is not nearly as long.  Two of my favorites are RealAudio and Macromedia Flash.  Both of these types require special programs to play and create.  Go to http://www.real.com or http://www.macromedia.com to get them.

Streaming RealAudio requires a special server but you can play small sounds quickly by inserting regular HTML code along with a file generated by a Real compiler.  To do this, follow these steps:

  1. Use an <object id="RAOCX" classid= "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height = "100" width = "200"> the object id and class id refer to the particular type of media; it is recommended that you copy and paste these from somewhere.
  2. Input the parameters and the values for them, here is the one which selects the file to played <param name="SRC" value = "meowmix.rm">.  <param name = "autostart" value = "true"> determines whether or not the clip should play as soon as it is loaded.
  3. End the section with the tag </object>

Macromedia Flash is a little less complicated to set-up, and it streams regardless of which web server you happen to use; its better for animations.  Follow these instructions to set up a movie:

  1.   Begin with the tag <embed width = "250" height = "110" src="chaos.swf"> 
  2. Add a <noembed>You don't have shockwave</noembed> for those people without flash installed.
You need Shockwave, go download it

Well, I hope you've learned plenty of new ways to add character to your site and several minutes to the loading time.  If this wasn't confusing enough, go on to  Lesson 9- Frames and Things for a real challenge.

Table of Contents