- This extension is enabled by default on Fandom.
Fandom has been thoroughly pleased to announce the EmbedVideo feature, a "new" way to embed videos onto pages originally used on Gamepedia wikis, which is now available across all of Fandom.
Rather than "uploading" a video via the video embed tool and needing to maintain File: pages for each video, this tool allows for videos to be embedded onto pages using a simple wikitext parser function.
Step-by-step[]
- Confirm that the video or audio file you wish to use is on the list of supported services — over 30 are supported, including all of the services supported by the original video embed tool.
- Use the table to find the service name and the individual video's ID. With the exception of SoundCloud, the video ID is a piece of the URL where the video is located. For example, in the YouTube URLs https://youtu.be/Vois0RMtPHE or https://www.youtube.com/watch?v=Vois0RMtPHE, the ID would be
Vois0RMtPHE
. The table will help you identify the video ID from a given video service. - With the service name and ID in hand, use this syntax to make an unformatted video embed:
{{#ev:service|id}}
For our YouTube example, our parser function would be written as {{#ev:youtube|Vois0RMtPHE}}
, which looks like what you see below:
SoundCloud exception[]
For SoundCloud embeds, the entire URL is the video ID, so if you wished to embed the same video using SoundCloud's player, you would use this:
{{#ev:soundcloud|https://soundcloud.com/madeon/technicolor-original}}
Which produces this:
As a note, Fandom's previous SoundCloud extension used the <soundcloud>
tag rather than EmbedVideo, so that tag is far more commonplace than the #ev
parser function — as such, specific usage-instructions for that parser tag have been included in Help:Audio, the <soundcloud>
tag has been feature of the EmbedVideo extension since version 2.7.0, so either method will produce the same embed.
Formatting your videos[]
All formatting settings that can currently be accomplished with the video embed tool can be accomplished with EmbedVideo too! This is the syntax:
{{#ev:service|id|dimensions|alignment|description}}
- dimensions is the width of your video, e.g.
{{#ev:youtube|Vois0RMtPHE|200}}
for 200px-wide, or{{#ev:youtube|Vois0RMtPHE|200x400}}
for 200px-wide, 400px-tall.
- alignment declares the embed alignment, either left, right, center, or inline — if undefined, the default is left-alignment without float — explicitly defining "left" or "right" will cause text to flow around the video. Example:
{{#ev:youtube|Vois0RMtPHE||center}}
- description is the caption of your video! It accepts generic wikitext, e.g.
{{#ev:youtube|Vois0RMtPHE|||Hello ''world''!}}
Tags[]
The EmbedVideo parser function expects to be called in any of the following ways:
#ev - Classic parser tag[]
{{#ev:service|id}}
{{#ev:service|id|dimensions}}
{{#ev:service|id|dimensions|alignment}}
{{#ev:service|id|dimensions|alignment|description}}
{{#ev:service|id|dimensions|alignment|description|container}}
{{#ev:service|id|dimensions|alignment|description|container|urlargs}}
{{#ev:service|id|dimensions|alignment|description|container|urlargs|autoresize}}
{{#ev:service|id|dimensions|alignment|description|container|urlargs|autoresize|valignment}}
However, if needed optional arguments may be left blank by not putting anything between the pipes:
{{#ev:service|id|||description}}
<embedvideo>
- Tag hook[]
<embedvideo service="service">id</embedvideo>
Attributes for parser tags[]
Attribute | Required | Default | Description |
---|---|---|---|
service=" (see supported services)"
|
yes | The video service to call. | |
id="[id|url]"
|
yes | The raw ID of the video or URL from the player page. | |
dimensions="[width|widthxheight|xheight]"
|
no | 640
|
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: Some services such as Gfycat do not have standard heights and should be specified for each embed. |
alignment="[left|center|right|inline]"
|
no | none | 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. |
description="[wikitext]"
|
no | none | Display a description under the embed container. For line breaks use (see https://www.w3.org/TR/REC-xml/#AVNormalize)
|
container="[frame]"
|
no | none | Specifies the container type to use for the embed.
|
urlargs="modestbranding=1&version=3"
|
no | none | Allows extra URL arguments to be appended to the generated embed URL. This is useful for obscure options only supported on one service. |
autoresize="false"
|
no | true | Automatically resize videos when their size will cause them to break outside of their container element. |
valignment="[top|middle|bottom|baseline]"
|
no | none | 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. |
Support for VideoLink tags[]
Support for the unmaintained VideoLink extension's tags has been added since version 2.5. Originally, it was a standalone extension used and built for Wowpedia.
From the original extension documentation:
The VideoLink extension allows embedding of YouTube videos in articles; allowing for multiple linked videos to be played in a single embedded video player, first shown when a user clicks on a video link. The <vplayer /> specifies where the player should appear within the page, and the {{#vlink}} parser function allows creation of links that load a specific video.
<evlplayer>
- Tag hook for video container[]
Note that the use of the <vplayer>
tag is also acceptable here for backwards compatibility.
This evlplayer tag is used to position the video player container within the page.
<evlplayer id="player id" w="width" h="height" class="class" style="style">default content</evlplayer>
A default video can be set to fill the container by default instead of default content as well.
<evlplayer id="player1" w="480" h="360" service="youtube" defaultid="pSsYTj9kCHE" />
Attributes | Required | Default | Description |
---|---|---|---|
id | no | default | An optional unique identifier for this container |
w | no | 800 | Width to send to the embedded player when its generated |
h | no | achieve 16:9 from width | Height to send to the embedded player when its generated |
class | no | Additional CSS class to add to the container div | |
style | no | Additional in-line CSS to apply to the container div | |
defaultid | no | Video ID of default video, if you want a default video. | |
service | no | Service of default video, if you want a default video. |
An important caveat to make note of, is that the w
and h
attributes only effect the video that is being included into the container div, and not the actual container. For styling of the container, please use the class
or style
attributes.
#evl
- Parser function for video links[]
Note that the use of the {{#vlink}}
parser function is also acceptable here for backwards compatibility.
{{#evl:<video id>|<Link text>|service=youtube|player=<player id>}}
In addition to all of the attributes supported by the #evt
tag, these specific attributes apply to the #evl
(and #vlink
) tags. To maintain backwards compatibility, if you do not define a service
then youtube
is assumed.
Attributes | Required | Default | Description |
---|---|---|---|
video id | yes | none | The ID of the video you would like to play. Please note that the use of multiple video IDs separated by a semicolon is now deprecated. Please use the proper service for playlists if you would like to play multiple videos from a single link |
link text | yes | none | The text to display inside the link |
player | no | ‘default’ | Player container to load video in. Note that the ID ‘default’ will only exist if you’ve defined a player with no ID. |
initial video | deprecated | In the original VideoLink, this would define what video to play first if multiple videos were defined. Please see notes about in video id and start .
| |
start | deprecated | 0:00 | In the original VideoLink, this defined the start time of a video. Since we support multiple video services, this feature can now be replicated with the urlargs parameter. For backwards compatibility, this attribute will be respect on videos with the service youtube .
|
Advanced[]
The full breadth of this feature's capabilities is beyond the scope of this article, and can be viewed here. You can learn how to use #evt
for embedding videos in templates, #evu
to let EmbedVideo detect the service of your video for you, urlargs in the #ev
function that let you control at what point in the video the player starts, and even parser tag alternative syntaxes such as <embedvideo service="youtube">ID</embedvideo>
or <soundcloud url=""/>
.
Next pages[]
- View the Gamepedia Help article for this feature, including extra examples
- Learn how to add images to your wiki
- Learn how to use footnotes and references in your articles
Further help and feedback[]
- Browse and search other help pages at Help:Contents
- Check Fandom Community Central for sources of further help and support
- Check Contacting Fandom for how to report any errors or unclear steps in this article