Quick Reference: Audio and Video


We live in a world dominated by audio-visual media. Movies, television, radio, CDs, videos, DVDs, video games, and, yes, the Internet are all a part of our media culture. As a result, the temptation to at least experiment with audio and video to your Web pages may be too great to resist. However, keep in mind that audio and video can drastically slow down your pages. If you are merely creating a personal Web site for your own use and enjoyment, then don’t worry about it. Be creative and have a blast! On the other hand, if you are creating your site for business purposes, or if you are working as a Web developer for other people’s sites, consider carefully whether audio-visual media will genuinely contribute to the site. If its only reason for being there is that it looks “cool,” you may be better off leaving it out. In any case, here’s a summary of how to add audio and video files to your Web pages:

To Do This

Use This

Link to an external
audio file

<a href="audioFile.wav">Link</a>

Link to an external
video file

<a href="videoFile.avi">Link</a>

Embed an audio file
with <object>

<object data="audioFile.wav" type="audio/wav"
height="##" width="##" autostart="true">
</object>
(autostart="false" if you don’t want the audio to start automatically)

Embed an audio file
with <bgsound />

<bgsound src="/books/4/238/1/html/2/audioFile.wav" loop="#" />

Embed an audio file
with <embed>

<embed src="/books/4/238/1/html/2/audioFile.wav" autostart="false" (or true)
height="##" width="##"> </embed>

Embed a video file
with dynsrc

<img dynsrc="/books/4/238/1/html/2/videoFile.avi" />

Embed a video file
with <object>

<object data="videoFile.avi" type="video/avi"
height="##" width="##" >
</object>

Embed a video file
with <embed>

<embed src="/books/4/238/1/html/2/videoFile.avi"
height="##" width="##"
autostart="true" (or false) loop="false" (or true) >
</embed>




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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net