HTML Image and multimedia Cheat Sheet

<audio> … </audio>The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.
<img>The HTML <img> element embeds an image into the document.
<track>The HTML <track> element is used as a child of the media elements <audio> and <video>. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks or Timed Text Markup Language (TTML).
<video> … </video>The HTML Video element (<video>) embeds a media player which supports video playback into the document. You can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience.

Example

<img class="fit-picture"
src="/media/examples/grapefruit-slice-332-332.jpg"
alt="Grapefruit slice atop a pile of other slices">
<figure>
<figcaption>Listen to the T-Rex:</figcaption>
<audio
controls
src="/media/examples/t-rex-roar.mp3">
Your browser does not support the
<code>audio</code> element.
</audio>
</figure>
<video controls width="250"
src="/media/examples/friday.mp4">
<track default kind="captions"
srclang="en"
WebsiteSetup.org - Beginner’ src="/media/examples/friday.vtt"/>
Sorry, your browser doesn't support embedded videos.
</video>

Leave a Reply

Your email address will not be published. Required fields are marked *