controls attribute on a media player specifies that the element should display its media controls (start, stop, time, volume, etc.). Elements that accept this attribute include <audio>, and <video>.
<audio controls> <source src="/media/epic.mp3" type="audio/mpeg"> </audio>
For additional details see our HTML audio controls Reference.
controls attribute specifies that the media player should display its controls.
In reality, without the
controls attribute users cannot interact with the player.
The controls contain the following button functions:
The following elements accept the
|<audio>||Creates an audio player -- see example above|
|<video>||Creates a video player|
<video width="320" height="240" controls> <source src="/media/movie.mp4" type="video/mp4"> <source src="/media/movie.ogg" type="video/ogg"> </video>
For additional details see our HTML video controls Reference.
Here is when
controls support started for each browser: