HTML multimedia refers to using HTML elements to embed audio, video, and other media into web pages.
1. HTML Video
The <video> tag is used to display videos.
<video width="500" controls> <source src="movie.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
Common attributes:
-
controls– Shows play, pause, and volume controls. -
autoplay– Starts the video automatically. -
loop– Repeats the video. -
muted– Mutes the audio. -
widthandheight– Set the video size.
2. HTML Audio
The <audio> tag is used to play audio files.
<audio controls> <source src="music.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
Common attributes:
-
controls -
autoplay -
loop -
muted
3. HTML Embed
The <embed> tag is used to embed external content such as PDF files or multimedia.
<embed src="file.pdf" width="500" height="400">
4. HTML Object
The <object> tag can embed images, PDFs, and other resources.
<object data="file.pdf" width="500" height="400"></object>
5. HTML Iframe
The <iframe> tag embeds another web page, such as a YouTube video.
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" title="YouTube video"> </iframe>
Advantages of HTML Multimedia
- Makes web pages more interactive.
- Supports audio and video without extra plugins.
- Improves user engagement.
- Works on most modern browsers.
Summary
HTML multimedia includes elements such as:
-
<video>– Displays videos. -
<audio>– Plays audio. -
<embed>– Embeds external media. -
<object>– Embeds files and multimedia. -
<iframe>– Embeds web pages or videos.
No comments:
Post a Comment