HTML EXAMPLE · WORKING REFERENCE

Add Audio & Video

Native audio aur video elements me controls aur fallback text use karke media embed structure banao.

Working code

<audio controls>
  <source src="lesson-audio.mp3" type="audio/mpeg">
  Your browser does not support audio.
</audio>

<video controls width="320">
  <source src="lesson-video.mp4" type="video/mp4">
  Your browser does not support video.
</video>
Run Code ▶

Preview

Media preview: actual audio/video tabhi play hoga jab valid media files lesson-audio.mp3 aur lesson-video.mp4 available hon.


How it works

controls browser ke playback controls show karta hai.

<source> media file aur MIME type define karta hai. Element ke andar fallback text unsupported browsers ke liye hai.

Try Yourself

<video controls width="400">
  <source src="demo.mp4" type="video/mp4">
  Video playback is not supported.
</video>

Learn this concept

Read related HTML Tutorial →