--- id: html-video title: "HTML Video" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["video element", "", "HTML5 video", "embed video", "video controls"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.90 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["html", "web", "frontend", "media", "video", "html5", "w3schools"] raw_sources: ["https://www.w3schools.com/html/html5_video.asp"] applied_in: [] github_commit: "" --- # [[HTML Video]] ## π― ν μ€ ν΅μ°° (One-line insight) The HTML `` element embeds video natively in a page; multiple `` children let the browser pick the first format it supports, with `controls`, `autoplay`, and `muted` attributes governing playback. [S1] ## π§ ν΅μ¬ κ°λ (Core concepts) - **`` shows video** β it embeds a video player directly, with `width` and `height` defining its size. [S1] - **`controls` adds the UI** β the `controls` attribute adds video controls such as play, pause, and volume. [S1] - **Multiple `` for fallback** β list several `` elements with different formats; the browser uses the first format it recognizes. Text between the tags is shown if none is supported. [S1] - **`autoplay` starts on load**, but Chromium browsers do not allow autoplay in most cases. [S1] - **`muted` enables autoplay** β adding `muted` after `autoplay` lets the video start automatically (muted autoplay is always allowed). [S1] - **Three HTML-standard formats** β MP4, WebM, and Ogg. [S1] - **Scriptable** β DOM methods, properties, and events let JavaScript load, play, and pause videos and set duration and volume. [S1] ## π§© μΆμΆλ ν¨ν΄ (Extracted patterns) - **Multi-source fallback pattern** β `` wrapping ordered `` elements + fallback text. [S1] - **Sized player pattern** β always set `width`/`height` to reserve layout space. [S1] - **Muted autoplay pattern** β `autoplay muted` to start playback within browser autoplay policies. [S1] ## π μΈλΆ λ΄μ© (Details) **The HTML `` element** β used to show a video on a web page. To show a video, use the `` element. The `controls` attribute adds video controls (play, pause, volume). It is good practice to include `width` and `height`; if not set, the page may flicker while the video loads. Multiple `` elements link to different video files β the browser will use the first recognized format. The text between `` and `` is shown only in browsers that do not support the element. [S1] ```html Your browser does not support the video tag. ``` **HTML `` autoplay** β to start a video automatically, use the `autoplay` attribute. Note: Chromium browsers do not allow autoplay in most cases; however, muted autoplay is always allowed: [S1] ```html Your browser does not support the video tag. ``` Add `muted` after `autoplay` to let the video start playing automatically (but muted): [S1] ```html Your browser does not support the video tag. ``` **HTML video formats** β there are three supported video formats: MP4, WebM, and Ogg. The MIME (media) type for each: [S1] | File Format | Media Type | |---|---| | MP4 | video/mp4 | | WebM | video/webm | | Ogg | video/ogg | MP4 has the broadest browser support. [S1] **HTML video β methods, properties, and events** β HTML defines DOM methods, properties, and events for the `` element. This allows you to load, play, and pause videos, as well as set duration and volume, and includes DOM events that can notify you when a video begins to play, is paused, etc. The source directs to the "HTML Audio/Video DOM Reference" for the full list. [S1] **HTML video tags** β [S1] | Tag | Description | |---|---| | `` | Defines a video or movie | | `` | Defines multiple media resources for media elements, such as `` and `` | | `` | Defines text tracks in media players | ## π οΈ μ μ© μ¬λ‘ (Applied in summary) The examples above are the canonical applied uses: a controlled player offering MP4 with an Ogg fallback, an autoplay variant, and a muted-autoplay variant that complies with modern browser autoplay policies. No external project/commit applications found in the source. ## π» μ½λ ν¨ν΄ (Code patterns) Standard video player with fallback (HTML): ```html Your browser does not support the video tag. ``` Muted autoplay (HTML): ```html ``` ## βοΈ λͺ¨μ λ° μ λ°μ΄νΈ (Contradictions & updates) No contradictions found in the source. The notable real-world constraint is browser autoplay policy: `autoplay` alone is blocked by Chromium browsers in most cases, so `muted` is required for reliable autoplay. [S1] ## β κ²μ¦ μν λ° μ λ’°λ - **μν:** draft - **κ²μ¦ λ¨κ³:** conceptual (μ€μ μ μ© μ¬λ‘ λ°κ²¬ μ applied/validatedλ‘ μΉκ²© κ°λ₯) - **μΆμ² μ λ’°λ:** B (W3Schools β widely used educational reference, not a primary standards body) - **μ λ’° μ μ:** 0.90 - **μ€λ³΅ κ²μ¬ κ²°κ³Ό:** μ κ· μμ± (New discovery) ## π μ§μ κ·Έλν (Knowledge Graph) - **μμ/루νΈ:** [[HTML Tutorial]] - **κ΄λ ¨ κ°λ :** [[HTML Audio]], [[HTML Media]], [[HTML Plug-ins]], [[HTML5]] - **μ°Έμ‘° λ§₯λ½:** Referenced when embedding playable video with cross-browser format fallbacks. ## π μΆμ² (Sources) - [S1] W3Schools β HTML Video β https://www.w3schools.com/html/html5_video.asp ## π λ³κ²½ μ΄λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "HTML Video" page (Astra wiki-curation, P-Reinforce v3.1 format).