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:
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: