Audio and Video

Audio

<audio controls>
    <source src="horse.mp3" type="audio/mpeg">
    Your browser does not support the audio tag.
</audio>

Video

<video width="320" height="240" controls>
    <source src="movie.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>

Audio and Video Options

The <audio> and <video> tags both have options that can be included or left out:

  • controls – display pause/play or volume controls
  • autoplay – play the audio clip automatically
  • loop – keep replaying the audio clip

Not all web browsers can include audio or video clips, so an error message should be display if this is the case.