Describe the process of embedding a video in an HTML document.

Instruction: Explain how to embed a video file in HTML5.

Context: This question tests the candidate's skill in using HTML5 multimedia elements, specifically video embedding, and their knowledge of the necessary attributes for optimal functionality.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Use video with native controls, a source the supported browsers can decode, and captions where the content requires them:

<video controls preload="metadata" poster="tour-poster.jpg" style="max-width:100%;height:auto;"> <source src="tour.webm" type="video/webm"> <source src="tour.mp4" type="video/mp4"> <track kind="captions" src="tour-en.vtt" srclang="en" label="English" default> Your browser does not support HTML video...

Related Questions