HTML Media
Media on a page includes more than a video file. Playback controls, file size, format support, captions, transcripts, and the visitor’s preferences all affect whether it is useful.
How it works
- A container format such as MP4 or WebM can hold different codecs. A filename extension alone does not guarantee that every browser can decode the contents.
- Provide controls and avoid depending on autoplay. Browsers often restrict playback that starts without a user gesture, especially with sound.
- Plan captions, transcripts, and audio description according to the content. Important information should not be available only through one sensory channel.
A practical example
<figure>
<audio controls preload="none">
<source src="media/welcome.mp3" type="audio/mpeg">
<a href="media/welcome.mp3">Download the welcome recording</a>
</audio>
<figcaption><a href="welcome-transcript.html">Read the welcome transcript</a></figcaption>
</figure>
Supply your own recording and transcript in a local project. The media does not intentionally download in full before the visitor chooses to use it.