Audio and Video Tag in Web Pages using HTML5

In HTML5, some new tags have been introduced such as audio and video.

For Video

<html>

<head>

</head>

<body>

    <video controls="controls" width="200">

<source src="filename.mp4" />

</video>

</body>

</html> 

Output



For audio with control:
 

<html>

<head>

</head>

<body>

    <audio controls="controls">

<source src="filename.mp3"  />

</audio>

</body>

</html>

Output


For audio auto play:
 

<html>

<head>

</head>

<body>

    <audio autoplay>

<source src="filename.mp3" />

</audio>

</body>

</html>

Ebook Download
View all
Learn
View all