Inserting movies and audio files into a page can be a frustrating experience. The HTML for working with movies and sounds is treated differently among different browsers. Microsoft Internet Explorer 3.0 and Netscape Navigator 3.0, for instance, recognize and interpret the same code in their peculiar ways--depending also on installed features and defaults--and a work-around solution for one won't work the same for the other.The following illustrations, therefore, are compromises adequate for both browsers but do full justice to neither one. Playing MoviesMovie files come in a variety of formats, a common one being AVI (Audio Video Interleave), which is used in the following illustrations. Similar techniques can be used for other formats. Also, since movie files can be quite large, it is usually best not to embed the movie for automatic play when the page is opened; the wait for downloading and playing can be lengthy. Rather, a link from text or a graphic image is used.
The HTML code, however, is the same for both browsers and the same as for other links--in this case it is to a movie file: <A HREF="movie.avi"><IMG SRC="image.gif"</A> (Recall, there are additional <IMG> parameters that can be included to control the size and placement of the clickable image.) Playing Sounds
In the same fashion as for movies, sounds can be played from your page (if you have a sound
card installed, of course). Again, several different formats are available (WAV, AU, AIFF,
MIDI), all of which should be playable through the sound application on your system. Click on
the image at the right to hear its associated sound. The particular player used will vary depending on
your system and browser configurations.
The HTML code for playing a sound file from a clickable image is the same as for playing a movie:
<A HREF="sound.mid"><IMG SRC="image.gif"</A>
Here, though, is where browsers differ significantly in their handling of embedded images. No standard HTML is available, so you have to decide whether to design you code for either Navigator or Internet Explorer, or perhaps both. To see the differences, click on the image that represents your browser to go to the page that handles it your way.
| |