Template:YouTube: Difference between revisions

From the Audiovisual Identity Database, the motion graphics museum

Content deleted Content added
imported>MirahezeGDPR 88da7cb7afcc9101e0b4087ac452ce79
No edit summary
imported>A. Smithee
moving documentation to Template:YouTube/doc
Line 21: Line 21:
-->{{#if:{{{id19|}}}|{{#ev:youtube|{{{id19}}}|dimensions={{#if:{{{width19|}}}|{{{width19}}}|240}}x{{#if:{{{height19|}}}|{{{height19}}}|185}}}|none|{{#if:{{{description19|}}}|<center>{{{description19}}}</center>}}|urlArgs=start={{{t19}}}}}}}<!--
-->{{#if:{{{id19|}}}|{{#ev:youtube|{{{id19}}}|dimensions={{#if:{{{width19|}}}|{{{width19}}}|240}}x{{#if:{{{height19|}}}|{{{height19}}}|185}}}|none|{{#if:{{{description19|}}}|<center>{{{description19}}}</center>}}|urlArgs=start={{{t19}}}}}}}<!--
-->{{#if:{{{id20|}}}|{{#ev:youtube|{{{id20}}}|dimensions={{#if:{{{width20|}}}|{{{width20}}}|240}}x{{#if:{{{height20|}}}|{{{height20}}}|185}}}|none|{{#if:{{{description20|}}}|<center>{{{description20}}}</center>}}|urlArgs=start={{{t20}}}}}}}</center></includeonly>
-->{{#if:{{{id20|}}}|{{#ev:youtube|{{{id20}}}|dimensions={{#if:{{{width20|}}}|{{{width20}}}|240}}x{{#if:{{{height20|}}}|{{{height20}}}|185}}}|none|{{#if:{{{description20|}}}|<center>{{{description20}}}</center>}}|urlArgs=start={{{t20}}}}}}}</center></includeonly>
<noinclude>
<noinclude>{{Documentation}}</noinclude>
A rewrite of the YouTube template which uses [[mw:Extension:EmbedVideo]]. The markup is unchanged by default, with the exception of the optional <code>width</code> and <code>height</code> parameters being replaced by a single <code>dimensions</code> parameter. For this parameter, input must be expressed as <code>(width) x (height)</code>. The new template also adds an optional <code>description</code> parameter which allows us to caption embedded videos in the same manner as images and directly uploaded videos (finally!). A new <code>t</code> parameter allows you to start the video at a certain timestamp, which didn't work properly with the old YouTube extension. Given EmbedVideo's broader capabilities, versions of this template can be created for Vimeo, Dailymotion, Archive.org and more.

Example markup (without description):
<code><nowiki>{{YouTube|id=yuo0EWZMTBc|id2=yuo0EWZMTBc|id3=yuo0EWZMTBc|id4=AZFjpcHNzNs|t4=21}}</nowiki></code>

Output (without description):
{{YouTube|id=yuo0EWZMTBc|id2=yuo0EWZMTBc|id3=yuo0EWZMTBc|id4=AZFjpcHNzNs|t4=21}}

Example markup (with description):
<code><nowiki>{{YouTube|id=yuo0EWZMTBc|description=this is the first video|id2=yuo0EWZMTBc|description2=this is the second video|id3=yuo0EWZMTBc|description3=this is the third video|id4=AZFjpcHNzNs|t4=21|description=this is a video with a timestamp (0:21)}}</nowiki></code>

Output (with description) (ignore the "Template Loop" message if it appears):
{{YouTube|id=yuo0EWZMTBc|description=this is the first video|id2=yuo0EWZMTBc|description2=this is the second video|id3=yuo0EWZMTBc|description3=this is the third video|id4=AZFjpcHNzNs|t4=21|description4=this is a video with a timestamp (0:21)}}
</noinclude>

Revision as of 21:30, 25 February 2023

Template documentation

A rewrite of the YouTube template which uses mw:Extension:EmbedVideo. The markup is unchanged by default, with the exception of the optional width and height parameters being replaced by a single dimensions parameter. For this parameter, input must be expressed as (width) x (height). The new template also adds an optional description parameter which allows us to caption embedded videos in the same manner as images and directly uploaded videos (finally!). A new t parameter allows you to start the video at a certain timestamp, which didn't work properly with the old YouTube extension. Given EmbedVideo's broader capabilities, versions of this template can be created for Vimeo, Dailymotion, Archive.org and more.

Example markup (without description): {{YouTube|id=yuo0EWZMTBc|id2=yuo0EWZMTBc|id3=yuo0EWZMTBc|id4=AZFjpcHNzNs|t4=21}}

Output (without description):


Example markup (with description): {{YouTube|id=yuo0EWZMTBc|description=this is the first video|id2=yuo0EWZMTBc|description2=this is the second video|id3=yuo0EWZMTBc|description3=this is the third video|id4=AZFjpcHNzNs|t4=21|description4=this is a video with a timestamp (0:21)}}

Output (with description) (ignore the "Template Loop" message if it appears):

this is the first video

this is the second video

this is the third video

this is a video with a timestamp (0:21)

</noinclude>

Cookies help us deliver our services. By using our services, you agree to our use of cookies.