Audio and Video in HTML
HTML5 introduced native audio and video support directly in the browser — no plugins needed. Before HTML5, websites needed Adobe Flash which was slow, insecure, and not mobile-friendly. Flash died December 31, 2020.
Video Element
<video width="640" height="360" controls poster="thumbnail.jpg"> <source src="video.mp4" type="video/mp4"/> <source src="video.webm" type="video/webm"/> Your browser does not support video. </video>
Autoplay Background Video
<video autoplay muted loop playsinline width="640"> <source src="bg.mp4" type="video/mp4"/> </video>
Audio Element
<audio controls preload="metadata"> <source src="audio.mp3" type="audio/mpeg"/> <source src="audio.ogg" type="audio/ogg"/> Your browser does not support audio. </audio>
Put fallback text between video and audio tags. It shows only on very old browsers that do not support HTML5 media — very rare today but still good practice.
Adobe Flash was the dominant video technology from 1996 to 2015. Steve Jobs refused Flash on the iPhone in 2007 forcing the industry toward HTML5 video. Adobe officially ended Flash on December 31, 2020.