Exp-5 Use of Audio on web pages using HTML5.

write this on the writing side

Create a webpage named audio.html to set an audio file in web page with controls such that it uses HTML5 elements. The audio file must play as soon as the webpage loads in browser and it will start over again, every time when it is completed.

Create another webpage named audio1.html which provides multiple source file formats for the same audio file that plays a sound automatically with controls. The browser should display the message with appropriate attribute, when audio file is not supported by browser. The code must incorporate the list of sound files formats (like wav, MP3 or ogg etc).

audio.html

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<audio controls loop="-1">
<source src="songs.mp3" type="audio/mpeg">
</audio>
</body>
</html>

audio1.html

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<audio controls autoplay>
<source src="songd.ogg" type="audio/ogg">
<source src="songs.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>

stick this output on the blank side

Leave a Comment

Scroll to Top