dev

YouTubeThumbnail allows the embedding and customization of YouTube video thumbnails into Fandom. One can customize which thumbnail to display in a div's data attribute.

Installation

  1. Add the script to your wiki's ImportJS:
  2. Create a {{YouTubeThumbnail}} template:

Usage

YouTubeThumbnail exposes some parameters for the user to customize:

id (positional)
The thumbnail ID of the thumbnail to be embedded, it's the same as the video ID. For example: dQw4w9WgXcQ.
width (optional)
How wide should the embedded image be, the aspect ratio will be preserved. For example: 300px.

Examples

Raw HTML usage
<div class="youtube-thumbnail" data-yt-thumb-id="dQw4w9WgXcQ"></div>
Basic usage
{{YouTubeThumbnail|dQw4w9WgXcQ}}
With everything
{{YouTubeThumbnail|dQw4w9WgXcQ|width=300px}}
Text above can be found here (edit)