Render Flow - Media formats overview
Read <video>
→Create VIDEO node
Read <audio>
→Create AUDIO node
The browser reads media tags, creates nodes, loads the media file, decodes the format, then renders video frames or plays audio.
<video controls width="320"> with one <source> element[Empty page]
[Video player box 320px wide] [Play button] [Progress bar] [Black screen area for video]
<video controls width="320"> <source src="movie.mp4" type="video/mp4"> <source src="movie.webm" type="video/webm"> Your browser does not support the video tag. </video> <audio controls> <source src="sound.ogg" type="audio/ogg"> <source src="sound.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
| Media Format | Type | Common Use | Browser Support | Notes |
|---|---|---|---|---|
| MP4 (H.264) | Video | Most devices and browsers | Very high | Widely supported, good quality/compression |
| WebM | Video | Open web format | High | Good for modern browsers, open source |
| OGG | Audio | Open audio format | High | Used for audio, open and royalty-free |
| MP3 | Audio | Audio playback | Very high | Most devices support it, lossy compression |
<audio> tag is designed to embed sound files like music or voice recordings.<img> is for images, <video> is for videos, and <sound> is not a valid HTML tag.<img> with a src attribute for the file path and an alt attribute for accessibility.<img> is self-closing and does not have a closing tag. The href attribute is incorrect for images.<video controls> <source src='movie.mp4' type='video/mp4'> <source src='movie.webm' type='video/webm'> Your browser does not support the video tag. </video>
<video> tag can have multiple <source> elements to provide different video formats for browser compatibility.controls attribute shows play/pause buttons. The fallback text appears only if the browser cannot play any source.<audio src='sound.mp3' controls> <source src='sound.ogg' type='audio/ogg'> </audio>
<source> tags inside <audio>, the src attribute on <audio> should be omitted to avoid conflicts.controls attribute is present, <source> tags do not require self-closing slash in HTML5, and type is valid.autoplay. To loop forever, use loop. To mute sound by default, use muted. Controls help user control playback.<video src='clip.mp4' autoplay loop muted controls></video> has all: autoplay, loop, muted, and controls. Others miss one or more attributes.<video src='clip.mp4' autoplay loop muted controls></video> [OK]Pass the test and this pattern moves unknown