Template:YouTube/doc

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

This template embeds a YouTube video into an image thumbnail, allowing it to blend seamlessly into a wiki page.

{{YouTube|dQw4w9WgXcQ|Example caption}}

Note: An earlier version of this template required directly using <youtube>...</youtube> tags within the {{{1}}} parameter. This is now deprecated, and will not work anymore.

Usage

The {{{1}}} parameter must be a YouTube video ID. For example, within this URL https://www.youtube.com/watch?v=dQw4w9WgXcQ, the part after v= would be the ID: dQw4w9WgXcQ.

The Doobie Brothers - Takin' It To The Streets (1977)
{{YouTube|i9_e0rRvyz8|The Doobie Brothers - Takin' It To The Streets (1977)}}

The above syntax will produce the video you see on the right (on desktop).

Positioning

Michael McDonald - I Keep Forgettin' (Every Time You're Near)

By default, the embedded YouTube thumbnail will float to the right, but you can also set it to float left or center like so:

{{YouTube|9gbQVj4MR3M|left|Michael McDonald - I Keep Forgettin' (Every Time You're Near)}}

The above syntax will produce the video you see on the left (on desktop).

Sizing

You can change the width of the embedded video by using the {{{width}}} parameter. By default, the width is 320px, and the height is 180px, giving you a 16:9 aspect ratio. If you change the width, this aspect ratio will be retained unless you also specify a {{{height}}} parameter.

{{YouTube|tM_7ZinEDKI|center|[[YouTube|AAAAAAA]] AA A AAAAAAA AAAA AA [[AAAAAAAAA!|AAAAAAAAA]]...|width=450px}}

The above syntax will produce the video you see below.

AAAAAAA AA A AAAAAAA AAAA AA AAAAAAAAA...

On mobile, the embedded video will automatically be rescaled to 320px, regardless of what you specify.


All parameters

You can also call the parameters by name.

  • id – the YouTube video ID, you can also directly set id to be the whole YouTube video URL, but this is strongly discouraged. Note: If you use this parameter, you must also directly call the other parameters like float or caption by name.
  • float – determines how the YouTube thumbnail will be positioned, can be set to left, right or center.
  • caption – the caption for the YouTube thumbnail
  • width – defaults to 320px, if specified, the height will automatically scale to keep a 16:9 aspect ratio.
  • height - defaults to 180px, if specified without width, the width will stay at 320px, so you must call both width and height to fully control the size of the embedded video.

Credit

Leverage, Jean Valjean and Ben DeRoy for pioneering the idea of putting YouTube embeds into wiki thumbnails