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