Template:VideoEmbed/doc

From Pirate Software Wiki
Revision as of 00:45, 6 October 2024 by Nelas (talk | contribs) (Created page with "{{doc/start}} {{tl|VideoEmbed}} is used to embed a Youtube or Twitch video. ==<u>Usage</u>== <pre>{{VideoEmbed |service= Service Provider |url= Full URL or Identifier |dimensions= <Width>x<Height> (Default to 304x171) |alignment= alignment (Default to 'inline') |description= Video title / description |container= container type |urlArgs= extra URL arguments |autoresize= true/false (Default to 'false') |valignment= vertical placement alignments |poster=File:TestFile.png...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Documentation

{{VideoEmbed}} is used to embed a Youtube or Twitch video.

Usage

{{VideoEmbed
|service= Service Provider
|url= Full URL or Identifier 
|dimensions= <Width>x<Height> (Default to 304x171)
|alignment= alignment (Default to 'inline')
|description= Video title / description
|container= container type
|urlArgs= extra URL arguments
|autoresize= true/false (Default to 'false')
|valignment= vertical placement alignments
|poster=File:TestFile.png
}}

Template parameters

Attribute Description Required? Default
service=(twitch/twitchvods/twitchclip/youtube) The video service to call. Required -
url=[id|url] The raw ID of the video or URL from the player page. Required -
dimensions="[WIDTH|WIDTHxHEIGHT|xHEIGHT]" Dimensions in pixels to size the embed container. The standard format is width x height where either can be omitted, but the x must proceed height to indicate it as the height.
Examples: 480,480x320,x320.
If the height is not provided it will be calculated automatically from the width and service default ratio.
Optional 304x171
alignment="[left|center|right|inline]" Align the placement of the video either to the left, centered, or to the right. Inline will allow multiple videos to display side by side without forced line breaks. Optional inline
description="[wikitext]" Display a description under the embed container. For line breaks use &#10; Optional none
container="[frame]" Specifies the container type to use for the embed.
frame — Wrap the video player in a MediaWiki thumbnail box.
Optional none
urlargs=start=32&end=42 Allows extra URL arguments to be appended to the generated embed URL. This is useful for obscure options. Works only on Youtube atm. Optional none
autoresize="false" Automatically resize video. Will use all available width of the parent element. Optional false
valignment="[top|middle|bottom|baseline]" Align the vertical placement of the video either to the top, middle, bottom, or baseline of the parent element. Using this parameter forces the alignment parameter to be inline. Optional none
poster="[File:TestFile.png]" Using a local file as an embed thumbnail Optional none


Examples:

Youtube with description and start time:

{{VideoEmbed|service=youtube|url=https://www.youtube.com/watch?v=NB5mqAJ9Vl0|description=Ferrets First Snow|urlArgs=start=10}}
Ferrets First Snow

Twitch with description, using all available space:

{{VideoEmbed|service=twitch|url=https://www.twitch.tv/ferretsoftware|description=FerretSoftware Livestream|autoresize="true"}}
FerretSoftware Livestream

Twitch VOD centered:

{{VideoEmbed|service=twitchvod|url=2261479736|alignment=center}}

Twitch Clip:

{{VideoEmbed|service=twitchclip|url=RenownedBlatantKangarooEleGiggle-tiuHBV-4AWQFN-B4}}

In combination with {{VideoGallery}}:

{{VideoGallery|
{{VideoEmbed|service=twitchclip|url=https://www.twitch.tv/ferretsoftware/clip/RenownedBlatantKangarooEleGiggle-tiuHBV-4AWQFN-B4|description=Doing a handstand while peeing}}
{{VideoEmbed|service=twitchclip|url=https://www.twitch.tv/ferretsoftware/clip/BovineRelatedAlbatrossCopyThis-FSuhy0lyvjg-JTif|description=Doing a flip}}
{{VideoEmbed|service=twitchclip|url=https://www.twitch.tv/ferretsoftware/clip/JollyHelpfulWeaselPJSugar-_YSvSmPEMkXQBsri|description=Making perfect landings}}
{{VideoEmbed|service=twitchclip|url=https://www.twitch.tv/ferretsoftware/clip/AdventurousFairGullThisIsSparta-J_GUReOSda-CpLzb|description=Henry cruising through the tubes}}
}}