These tutorials follow a progressive path from the fundamentals of web media through scripting and embedding third-party content. Work through them in order or jump to the topic you need.
Foundations
- Media on the web — How browsers handle media, the role of containers and codecs, and when to use native elements vs. embeds.
-
The audio element
— The
<audio>element, its attributes (controls,autoplay,loop,muted), and multiple<source>fallbacks. -
The video element
— The
<video>element,poster, responsive sizing, and the Picture-in-Picture API.
Formats & text tracks
- Formats & codecs — MP4/H.264, WebM/VP9, AV1, Opus, and AAC — browser support, trade-offs, and choosing the right format.
-
Captions & tracks
— WebVTT files, the
<track>element, andkindvalues: subtitles, captions, chapters, and metadata.
Scripting & embedding
-
Controlling media with JavaScript
— The
HTMLMediaElementAPI:play(),pause(),currentTime,volume, events, and building custom controls. -
Embedding external video
—
<iframe>embeds from YouTube, Vimeo, and others — responsive aspect-ratio wrappers and privacy considerations. -
Audio processing with the Web Audio API
— The audio graph,
AudioContext, gain nodes, analysers, and real-time visualization.