Link to Audio or Video Files

Just as you can link to an external image, you can add audio and video to your page simply by linking to a file. This is without a doubt the easiest way to add multimedia to your site. For example, in Chapter 8 a family album page was created to demonstrate the use of tables for layout. What if you decided you would like to have a recorded message available as a link? The message wouldn’t play automatically, nor would it be embedded as part of the page. Rather, it would be kept as a separate file; if anyone wanted to listen to it, they would just have to click the link.

Assuming you have already created the audio and video files you want to link to, all you need to do is use the anchor element <a> </a> with the href=" " attribute. The value for href=" " will be the filename of the audio/video clip. For an audio clip, your link might look like this one:

<a href="greeting.wav">Listen to a greeting.</a>

For a video clip, everything’s the same except for the filename:

<a href="">Watch my home movies.</a>

As you can see in the illustration that follows, your link will look like any other link. However, instead of taking your visitors to another page, a browser will load a plug-in (a special “helper” program) that plays the sound.

Adding audio and video to a page can be that simple. Of course, although using an external link might be the easiest way to add multimedia to your site, it might not be the best way. In fact, one of the more important aspects of adding multimedia is learning to sort out the different ways of including it on your site and choosing the right one for your purposes.

How to Do Everything with HTML & XHTML
How to Do Everything with HTML & XHTML
ISBN: 0072231297
EAN: 2147483647
Year: 2003
Pages: 126

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: