What is Multimedia Tags in HTML?
- Multimedia Tags are used to show multimedia files on a web page.
- Media files contain multimedia elements such as audio and video.
1). Audio
<audio> element is used to add an audio file on a web page.
<audio src="/assets/myAudio.mp3" controls autoplay muted></audio>
Audio Attributes
- autoplay: This attribute will start the audio file automatically when page reload.
- controls: This attribute will add the audio controls like play, pause, and volume controls.
- muted: This attribute will mute the audio file.
2). Video
<video> element is used to show video on a web page.
<video src="/assets/myVideo.mp4" width="400px" height="200px" controls></video>
<video> element is used to show video on a web page.
<video src="/assets/myVideo.mp4" width="400px" height="200px" controls></video>
Video Attributes
- controls: It will add the video controls like play, pause, and volume controls.
- autoplay: This will start the video automatically.
- muted: This attribute will mute the audio of the video file.
- width: This attribute is used to add width to the video.
- height: This attribute is used to add height to the video.
Code Described in the video
Code Described in the video
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Multimedia in HTML</title>
</head>
<body>
<!-- Audio in HTML -->
<audio src="/assets/myAudio.mp3" controls autoplay muted></audio>
<!-- Video in HTML -->
<video src="/assets/myVideo.mp4" width="400px" height="200px" controls></video>
</body>
</html>