Template:YouTube: Difference between revisions

From VRChat Wiki
Hackebein (talk | contribs)
Add more description for parameters
m fix: swap to embedvideo over custom impl
Line 1: Line 1:
<div
{{#ev:youtube|id={{{id|{{{1|PWLPw4RE9Ig}}}}}}|width={{{width|{{{2|560px}}}}}}|poster={{{thumb|{{{3|PWLPw4RE9Ig}}}}}}}}
  class="youtube"
  style="max-width: 100%; aspect-ratio: {{{3|16 / 9}}}; background-color: black; width: {{{2|560px}}}; height: auto; {{{4|}}}"
  data-video-id="{{{1|PWLPw4RE9Ig}}}"
></div>
<noinclude>
<noinclude>
== Documentation ==
== Documentation ==
Embeds a YouTube video.
Embeds a YouTube video.


<nowiki>{{Youtube|id|width|ratio|styles}}</nowiki>
<nowiki>{{Youtube|id|width|thumb}}</nowiki>
=== Example Usage ===
=== Example Usage ===
{{YouTube|PWLPw4RE9Ig}} <nowiki>{{YouTube|PWLPw4RE9Ig}}</nowiki>
{{YouTube|PWLPw4RE9Ig}} <nowiki>{{YouTube|PWLPw4RE9Ig}}</nowiki>
Line 16: Line 12:
{{YouTube|PWLPw4RE9Ig|100%}} <nowiki>{{YouTube|PWLPw4RE9Ig|100%}}</nowiki>
{{YouTube|PWLPw4RE9Ig|100%}} <nowiki>{{YouTube|PWLPw4RE9Ig|100%}}</nowiki>
<hr>
<hr>
{{YouTube|qivRiGWcowI|300px|9 / 16}} <nowiki>{{YouTube|qivRiGWcowI|360px|9 / 16}}</nowiki>
{{YouTube|PWLPw4RE9Ig|thumb=File:VRChat - Create, Share, Play Thumbnail.webp}} <nowiki>{{YouTube|PWLPw4RE9Ig|thumb=File:VRChat - Create, Share, Play Thumbnail.webp}}</nowiki>
<hr>
{{YouTube|qivRiGWcowI|30%|9 / 16}} <nowiki>{{YouTube|qivRiGWcowI|20%|9 / 16}}</nowiki>


=== Template parameters ===
=== Template parameters ===
Line 30: Line 24:
| width  || <code>2</code>|| Width in CSS units (e.g. 200px, 100%), Default: 560px, Recommended for 9 / 16 Ratio: 360px
| width  || <code>2</code>|| Width in CSS units (e.g. 200px, 100%), Default: 560px, Recommended for 9 / 16 Ratio: 360px
|-
|-
| ratio || <code>3</code>|| Ratio (e.g. 16 / 9, 9 / 16, 1 / 1), Default: 16 / 9
| thumb  || <code>3</code>|| Local file to use as thumbnail.  
|-
| style || <code>4</code>|| Custom CSS styles
|}
|}


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 08:50, 10 January 2026

Documentation

Embeds a YouTube video.

{{Youtube|id|width|thumb}}

Example Usage

{{YouTube|PWLPw4RE9Ig}}

{{YouTube|PWLPw4RE9Ig|200px}}

{{YouTube|PWLPw4RE9Ig|100%}}

{{YouTube|PWLPw4RE9Ig|thumb=File:VRChat - Create, Share, Play Thumbnail.webp}}

Template parameters

Name Variable Description
id 1 ID of the video
width 2 Width in CSS units (e.g. 200px, 100%), Default: 560px, Recommended for 9 / 16 Ratio: 360px
thumb 3 Local file to use as thumbnail.