Performance: Video tag basics
This affects page load speed and rendering performance by how video files are loaded and displayed in the browser.
<video controls preload="metadata" poster="thumbnail.jpg" src="optimized-video.webm" loading="lazy"></video>
<video src="large-video.mp4" autoplay controls></video>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager large video load | Minimal | 1 (layout for video size) | High (large video frames) | [X] Bad |
| Lazy load with metadata preload | Minimal | 1 (layout for video size) | Low (small metadata first) | [OK] Good |
<video> tag in HTML?<video> tag?controls without any extra letters.controls correctly; others have incorrect or non-existent attributes.controls attribute to add buttons [OK]<video controls> <source src="video.webm" type="video/webm"> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
<video src="movie.mp4" controls> <source src="movie.webm" type="video/webm"> </video>
src and <source> tags<source> tags, the src attribute on <video> should be omitted to avoid conflicts.controls is spelled correctly, <source> tags do not require closing slashes in HTML5, and multiple sources are allowed.src attribute should not be used with <source> tags inside <video> -> Option Bsrc or <source>, not both [OK]<video> tag to achieve this?autoplay, loop, and muted enable automatic play, repeating, and silent start respectively.Pass the test and this pattern moves unknown