Page 104 - CodePilot V5.0 C7
P. 104
ADDING AUDIO AND VIDEO
Adding audio and video makes the web page more engaging and allows people to communicate
quickly and effectively. The following formats are supported by all browsers. To add music or
audio to your web page, you need an audio/video file in one of the following formats:
Format File extension Description
WAV .wav Waveform Audio File Format (WAV) is an audio format. It
was developed by IBM and Microsoft. Files in this format play
well on Windows, Macintosh and Linux operating systems.
OGG .ogg Ogg Vorbis (OGG) was developed by the Xiph.Org
Foundation. It is an audio format.
MP3 .mp3 MPEG Audio Layer 3 (MP3) is an audio format supported by
all web browsers. It is an audio format. These are small files
with high quality.
MP4 .mp4 MPEG-4 Part 14 (MP4) is a video format, but can also be
used for audio.
WEBM .webm It is a video format supported by all browsers.
AVI .avi It is a proprietary video format introduced by Microsoft.
The HTML tag, used for adding audio files to a web page, is <AUDIO> and for adding video
is <VIDEO>. The <AUDIO> and <VIDEO> tags can play all the supported audio and video formats
listed in the table above.
The attributes used with these tags are:
Attribute Name Value Description
SRC URL or path of the file It specifies the path or URL of the file.
CONTROLS None It specifies whether the controls are shown along
with audio or video.
LOOP None It is used to play the video in a loop continuously.
AUTOPLAY None It is used to play the video automatically as the
page loads. Since this attribute is not supported by
browsers like Chrome, Opera and Microsoft Edge,
you need to add the word MUTED after AUTOPLAY.
WIDTH, HEIGHT Pixel value These attributes are used to adjust the height and
width of the video window.
102
CodePilot (V5.0)-VII

