Wiki: YouTube Directive

You are viewing the current revision of this article.
To see the canonical URL, visit: Go to Latest Version
Improved by
MaggieTheBot & others
M QINGCHARLES
Last Updated

The {{YouTube}} directive embeds a responsive, privacy-preserving video player.

Syntax

{{YouTube VIDEO_REF |#| Title=Descriptive title |#| StartSeconds=45 |#| Caption=Optional caption}}

				

Parameters

Parameter Required Description
Video Reference Yes 11-character YouTube video ID or accepted YouTube URL.
Title= Yes Plain text title used for the video banner and accessibility label.
StartSeconds= No Playback start offset in seconds (e.g. 90).
Caption= No Optional caption rendered in a <figcaption> beneath the player.

Accepted URL Formats

Privacy & Performance Design

Example

{{YouTube https://youtu.be/M7lc1UVf-VE |#| Title=Byte Magazine Retrospective |#| StartSeconds=30 |#| Caption=A documentary retrospective on early computing periodicals.}}

				

Linking to YouTube in text

To name a video, channel or handle in a sentence, use {{YouTubeLink}} instead of pasting a YouTube address or a raw channel ID. It renders an ordinary link with a small YouTube play mark.

The publisher posted the {{YouTubeLink Video=M7lc1UVf-VE |#| Label=launch trailer}} on its
{{YouTubeLink Channel=UCxNu4IGHko2yxmagLfqHtxw |#| Label=official channel}}, later {{YouTubeLink Handle=@example |#| Label=@example}}.

				
Parameter Required Description
Video= One of these three 11-character video ID or any accepted YouTube video URL (a timestamp is kept).
Channel= One of these three Channel ID: UC followed by 22 characters.
Handle= One of these three Handle, with or without @.
Label= Yes The text readers see, usually the video's title or the channel's name.

It works in paragraphs, tables, infobox values (such as Website=) and timeline descriptions. If a value is invalid the directive shows as text, and saving reports why. Cite a YouTube source with {{Citation ... |#| url=...}}.


Return to the Formatting Guide.