Template:YouTube: Difference between revisions
Appearance
| [checked revision] | [checked revision] |
Update Tag: Manual revert |
Update Template |
||
| Line 35: | Line 35: | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude><includeonly><div style="text-align:{{{align|center}}}; margin: | </noinclude><includeonly><div class="soji-yt-embed" style="text-align:{{{align|center}}}; margin:12px 0;" data-video-id="{{#explode:{{#explode:{{{id|}}}|?|0}}|&|0}}" data-width="{{{width|640}}}"><div class="soji-yt-thumb-wrap" style="position:relative; display:inline-block; width:{{{width|640}}}px; max-width:100%; aspect-ratio:16/9; cursor:pointer; overflow:hidden; border-radius:8px; background:#000;"><img src="https://i.ytimg.com/vi/{{#explode:{{#explode:{{{id|}}}|?|0}}|&|0}}/hqdefault.jpg" alt="Video thumbnail" loading="lazy" style="width:100%; height:100%; object-fit:cover; display:block;"><div class="soji-yt-play-overlay" style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:72px; height:50px; background:rgba(0,0,0,0.7); border-radius:14px; display:flex; align-items:center; justify-content:center; transition:background 0.2s;"><svg width="36" height="26" viewBox="0 0 36 26" fill="white"><polygon points="14,7 14,19 25,13"/></svg></div></div>{{#if:{{{caption|}}}|<div style="margin-top:8px; font-style:italic; color:#666; font-size:0.9em;">{{{caption}}}</div>|}}</div></includeonly> | ||
Revision as of 08:25, 25 May 2026
YouTube Embed Template
Embed YouTube video. Auto-strips query parameters from ID.
Usage: {{YouTube|id=VIDEO_ID|width=640|align=center|caption=Description}}