You can add audio
and video elements to your Web pages by using the <EMBED> tag. We will show you how
to use HTML to add audio and video files by using examples and explanations. However, keep
in mind these following things if you want visitors to access audio and video on your Web
pages:
- A Web page can support audio files in WAV, AIF, AU, or MID
format.
- The audio files must be stored somewhere on the Internet.
Normally, the files are stored on the same server(the computer that stores your Web pages)
that stores the rest of Web page
Example1: Add audio file to your Web page.
<EMBED SRC = "audio.wav" AUTOSTART = "TRUE"
LOOP="INFINITE" HIDDEN="TRUE" VOLUME="100%">
Explanation1:
- SRC="audio.wav" : specifies the location or the
address of the audio file "audio.wav" on the server.
- AUTOSTART="TRUE" : specifies that the audio file
is automatically played in the background anytime when the Web page is loaded. However,
the visitors cannot turn off the sound file. If you don't want any sound file, leave the
option AUTOSTART setting out of the coding.
- LOOP="INFINITE": causes the sound file to repeat
continuously as long as the visitor is still on that Web page.
-
HIDDEN="TRUE" : When HIDDEN is set to TRUE, it
hides the control panel for the audio file. It's a good idea to give your visitors
the control panel, so they can control the sound on your Web page. For example, they can
turn up the volume of the sound file. If you want the control panel to appear on
the screen, leave the HIDDEN setting out of the HTML coding or set it to FALSE.
-
The setting VOLUME="100%" will specify how loudly your audio file is.
Example2: Add audio file to your Web page.
<EMBED SRC = "audio.wav"
WIDTH="144" HEIGHT="74">
Explanation2
- The control panel will appear on your Web page, and the
visitors will be given the control of the sound file. There will have options on the
control panel: Stop, Play, Pause, and a volume control bar.
- The attributes WIDTH and HEIGHT and their values specify the
dimension of the control panel. If you leave out these attributes and their values, there
is only one Stop button appear on the control panel.
Example3: Adding video files to your Web page is
similar to adding audio files to your Web pages, except that there is not an on-screen
video control panel.
<EMBED SRC = "video.mov"
WIDTH="313" HEIGHT="252">
- SRC attribute specifies where the video file
"audio.mov" is located. It could be a long address like this one: SRC="http://www.myserver.com/~yourname/video/video.mov"
- The WIDTH and HEIGHT attributes specify the size of the
frame for the video image to be displayed. However ,there is no maximum or minimum setting
for these dimensions.
|