Page 85 - TP_Play_V2.1_class8
P. 85
Imagine, creating a website that hosts interactive debates and discussions. How
would you use HTML to structure the conversation and incorporate multimedia
content? Design a web page that would foster meaningful exchanges among
participants?
ADDING AUDIO AND VIDEO
The HTML5 <AUDIO> and <VIDEO> tags allow us to add media (audio and video) into a
website. To add media, we are required to set SRC attribute to specify the media source and we
can include the "controls" attribute to allow users to play, pause and control the media playback.
The attributes of <AUDIO > and <VIDEO> tags are as follows:
Autoplay Attribute: The "Autoplay" attribute is a boolean attribute that plays the video
automatically as soon as the page loads
Controls Attribute: The "control" attribute allows users to gain control over how the video is
played.
Adding Audio
We use <AUDIO> tag to embed sound content in an HTML document.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Audio</TITLE>
</HEAD>
<BODY>
<H1 STYLE="TEXT-ALIGN: center; COLOR: red;">Welcome to the Musical World</H1>
<P STYLE="TEXT-ALIGN: center;">
<BR>
<IMG SRC="MusicalNote.jpg">
</P>
<AUDIO SRC="Flute.mp3" CONTROLS
AUTOPLAY>
</AUDIO>
</BODY>
</HTML>
Adding Video
Output
We use <VIDEO> tag to embed video in an HTML document.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Video</TITLE>
</HEAD>
Images, Links and Frame in HTML5 83

