HTML Media Elements
HTML Media Elements
HTML media elements are HTML tags that let you add video and sound to a web page. The browser plays them on its own, so no extra plugins are needed.
Multimedia on the web is sound, music, videos, movies, and animations.
Multimedia elements (like audio or video) are stored in media files.
Web pages often contain multimedia elements of different types and formats.
The most common way to discover the type of a file, is to look at the file extension.
Supported Video Formats in HTML5
The HTML <video> element is used to show a video on a webpage.
There are many video formats out there, but the supported video formats for HTML are:
| Video Format | File Extension | Description |
|---|---|---|
| MPEG-4 or MP4 |
.mp4 | Developed by the Moving Pictures Expert Group (MPEG). Commonly used in video cameras, smartphones and video platforms like YouTube |
| Ogg | .ogg | Open-source and developed by the Xiph.Org Foundation |
| WebM | .webm | Developed by the WebM Project (Mozilla, Opera, and Google) |
Supported Audio Formats in HTML5
The HTML <audio> element is used to play
a sound on a webpage.
There are many audio formats out there, but the supported audio formats for HTML are:
| Audio Format | File Extension | Description |
|---|---|---|
| MP3 | .mp3 | MP3 files are actually the sound part of MPEG files. MP3 is the most popular format for music players. Combines good compression (small files) with high quality |
| WAV | .wav | Developed by IBM and Microsoft. Plays well on Windows, Macintosh, and Linux operating systems. |
| Ogg | .ogg | Developed by the Xiph.Org Foundation. |