© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
K. WilsonThe Absolute Beginner's Guide to HTML and CSShttps://doi.org/10.1007/978-1-4842-9250-1_6

6. Multimedia

Kevin Wilson1  
(1)
WIDNES, UK
 

Using the HTML5 specification, it is a lot easier to embed multimedia into your website. You can easily embed video, music, animations, and sound.

Multimedia files have various file extensions.

Audio files can be .wav, .mp3, .aac, or .wma.

Video files can be .mp4, .mpg, .wmv, .webm, or .avi.

Photos and illustrations are usually .jpg, .png, or .webp.

Adding Video

Use the built-in <video>…</video> tags:
    <video width="450" controls autoplay>
        <source src="video.mp4" type="video/mp4">
    </video>

Use the source attribute ...

Get The Absolute Beginner's Guide to HTML and CSS: A Step-by-Step Guide with Examples and Lab Exercises now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.