Lesson 10 of 55
HTMLMultimedia – Audio and Video
11 min
Course progress18%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 10 of 55
HTML11 min
Keep these ideas in mind as you work through the lesson.
<video controls width='640'>
<source src='movie.mp4' type='video/mp4' />
<source src='movie.webm' type='video/webm' />
<track kind='captions' src='captions.vtt' srclang='en' label='English' default />
Your browser does not support the video tag.
</video>
<audio controls>
<source src='song.ogg' type='audio/ogg' />
<source src='song.mp3' type='audio/mpeg' />
Your browser does not support the audio element.
</audio>
controls – Adds native playback UI (play/pause, volume, timeline).autoplay, loop, muted – Additional behaviours; use sparingly to avoid unexpected media playback.preload – metadata (default), auto, none. Setting metadata loads only duration and dimensions.<track> – Provides subtitles, captions, descriptions, chapters, or metadata for video/audio.crossorigin – Required when fetching media from a different origin and you intend to use the MediaElement API.kind='captions').aria-label or <track kind='descriptions'> for describing visual content to screen readers.<source> with HLS (.m3u8) or DASH (.mpd) for adaptive bitrate streaming.<track kind='captions'>) provided for video? ✅preload='metadata' used for non‑critical media? ✅controls attribute)? ✅mp4, webm, ogv) offered? ✅Tip: Test with the Captions preference in the OS and ensure captions appear and sync correctly.