Chapter 6: HTML MULTIMEDIA

.1 Audio

The audio element is used to embed sound into a webpage. Supported formats: MP3, WAV, and OGG (MP3 recommended).

  • controls – shows play/pause, timeline, volume
  • autoplay – plays audio automatically
  • muted – starts with no sound
  • loop – repeats automatically
  • preload – load audio when page loads

Example 1: Audio with multiple sources

Example 2: Audio with src attribute

.2 Video

The video element is used to embed video into a webpage. Supported formats: MP4, WebM, OGG (MP4 recommended).

  • controls – shows play/pause, timeline, volume
  • autoplay – plays video automatically
  • muted – starts with no sound
  • loop – repeats automatically
  • preload – load video when page loads
  • width / height – set player size

Example 1: Video with src attribute

Example 2: Video with multiple sources