Interview Question

How do you embed videos in HTML?

Embed videos with controls, fallback text, and captions.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

Use `<video>` for a video file or an iframe for a trusted video service. • Add controls and captions so more people can use it. • Prefer native HTML elements before adding custom scripted behavior. • Test the result with a keyboard, a small screen, and browser developer tools.

💡 Simple Example

<video controls><source src="lesson.mp4" type="video/mp4"><track kind="captions" src="captions.vtt"></video>

⚡ Quick Revision

Embed videos with controls, fallback text, and captions.