Skip to main content
Albero Academy

Audio & Video

Embed media natively with the audio and video elements.

Media & Embeds8 min

HTML5 added native <audio> and <video> elements — no plugins needed. They come with built-in playback controls and support multiple source formats.

The video element

video with controls
<video controls width="640" poster="thumb.jpg">
<source src="clip.mp4" type="video/mp4" />
<source src="clip.webm" type="video/webm" />
<track kind="captions" src="captions.vtt" srclang="en" />
Your browser doesn't support video.
</video>
<audio controls>
<source src="song.mp3" type="audio/mpeg" />
</audio>

Key takeaways

  1. 01HTML5 <video> and <audio> embed media natively — no plugins.
  2. 02Multiple <source> elements let browsers pick a format they support.
  3. 03Add controls for playback UI; add <track> captions for accessibility.
  4. 04autoplay/loop/muted control behaviour (autoplay-with-sound is blocked).

Finished this chapter?

Mark it complete to track your progress through HTML.