Media Tags
Last Updated: 01 Nov 2025
HTML Media tags are used to embed multimedia content like:
- 🎵 Audio (music, sound effects)
- 🎥 Video (movies, clips)
- 🌐 Other pages (using iframe)
These tags make web pages more interactive and user-friendly.
🗣 Hinglish Tip: Media tags se hum web pages ko boring text se zyada interesting bana sakte hain — jaise YouTube player, songs, ya Google Maps embed karna!
🎥 HTML Video Tag
Used to play video files like .mp4, .webm, etc.
🧱 Syntax:
<video controls>
<source src="movie.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
Attributes used:
controls→ Adds controls to the video playersrc→ Specifies the path or URL of the video filetype→ Specifies the type of the video fileautoplay→ Autoplay the video when the page loadsloop→ Loop the video when it endsmuted→ Mute the videoposter→ Sets a poster image for the videowidth→ Sets the width of the video playerheight→ Sets the height of the video player
Example
<video width="500" height="280" controls poster="thumbnail.jpg">
<source src="videos/nature.mp4" type="video/mp4" />
<source src="videos/nature.webm" type="video/webm" />
Your browser does not support video tag.
</video>
🗣 Hinglish Tip: controls lagana mat bhoolna — bina controls ke user play/pause nahi kar sakta.Poster attribute se video start hone se pehle image dikhai deti hai — jaise YouTube thumbnail!
🎧 HTML Audio Tag
Used to play sound or music files.
🧱 Syntax:
<audio controls>
<source src="song.mp3" type="audio/mpeg" />
Your browser does not support the audio tag.
</audio>
Attributes used:
controls→ Adds controls to the audio playersrc→ Specifies the path or URL of the audio filetype→ Specifies the type of the audio fileautoplay→ Autoplay the audio when the page loads but it is muted by defaultloop→ Loop the audio when it endsmuted→ Mute the audio
Example
<audio controls autoplay loop muted>
<source src="audio/song.mp3" type="audio/mpeg" />
Your browser does not support audio.
</audio>
🌐 HTML Iframe Tag
Used to embed another webpage, YouTube video, Google Map, etc., inside your page.
🧱 Syntax:
<iframe src="https://example.com" width="500" height="300"></iframe>
Attributes used:
src→ Specifies the URL of the webpage to embedwidth→ Sets the width of the iframeheight→ Sets the height of the iframeframeborder→ Adds a border around the iframeallowfullscreen→ Enables fullscreen mode in the iframeallow→ Enables specific features in the iframetitle→ Adds a title to the iframereferrerpolicy→ Sets the referrer policy for the iframeloading→ Sets the loading strategy for the iframe
Example 1: Embed YouTube Video
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
>
</iframe>
🗣 Hinglish Tip: allowfullscreen lagao agar video ko full screen banana hai.Ye bilkul YouTube ka embedded player jaisa kaam karta hai.
Example 2: Embed Google Map
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!..."
width="400"
height="300"
allowfullscreen=""
loading="lazy"
referrerpolicy="no-referrer-when-downgrade"
>
</iframe>