Please remember that WiKirby contains spoilers, which you read at your own risk! See our general disclaimer for details.

Template:VideoEmbed

From WiKirby, your independent source of Kirby knowledge.
Jump to navigationJump to search

Why does this template exist?[edit]

Currently, the EmbedVideo extension we're using doesn't quite handle video dimensions gracefully. Indeed, once we figure out how to get the extension to work persistently with dimensions (which relies on a gestalt entity between EmbedVideo, MediaWiki, and ffprobe), this template should be obsolete.

However, in the meantime, without the proper resolution information, MediaWiki/EmbedVideo is forced to automatically assume that the video element should follow a 16:9 aspect ratio, which is not the case for many videos of interest to WiKirby. For instance, the first video uploaded to the wiki is a 10:9 Game Boy screen capture:

However, if we know the appropriate width and height, this template allows us to hide the extraneous parts of the video. For instance, our 10:9 video can look like this:


Usage[edit]

The template takes three anonymous parameters, namely the name of the file (without File:), the desired width, and the desired height. The last parameter is optional, but without it the result is effectively identical to the default MediaWiki/EmbedVideo functionality.

{{VideoEmbed|KDL pause animation.mp4|320}}


As long as the appropriate aspect ratio must be known in advance, the width and height may be freely specified:

{{VideoEmbed|KDL pause animation.mp4|86|77|gif=y}}


The only two caveats are as follows:

  • Currently the template only handles videos with width/height < 16/9 (that is, appropriate display of super-wide videos is not supported).
  • Technical limitations limit the maximum height to 360px.
{{VideoEmbed|KBBl Twitter - Green Greens.mp4|300|225|poster=KRBaY E001 end scene screenshot.png|thumbalign=left|thumbcaption=<code>[...]</code>}}
{{VideoEmbed|KDL dance.mp4|250|225|thumbcaption=<code>[...]</code>}}

There are five optional named parameters:

  • thumbcaption, if specified, causes the video to be shown in a framed thumbnail format with a magnify link for supported skins. The argument then becomes the caption.
  • thumbalign specifies the alignment of the framed video (default: right).
  • gif, if specified in any way, passes gif to the video object as handled by EmbedVideo, which turns on muted autoplay and disables controls.
  • poster, if specified, uses the specified file path as a custom thumbnail image for the video, regardless of whether that image has anything to do with the video. The image goes away completely once the reader initiates playback, and will not return after playback concludes. Still, use judiciously.
  • mw-assumed-height-over-width specifies the height-to-width ratio that MediaWiki assumes for video elements (default: 0.5625 = 9/16). This should not need any ad hoc adjustments.