EmbedVideo is a default MediaWiki extension that allows for embedding videos.
The master documentation for EmbedVideo is available on MediaWiki.
Example usage[]
- See also: Extension:EmbedVideo/Example
- Embedding videos on Fandom and Gamepedia wikis is possible because of the MediaWiki default extension, EmbedVideo.
- For this example, we'll be using the front page of the Help Wiki and the video in the "How To Video" block.
- If you look at the edit page, you'll notice that the syntax looks like this:
{{#ev:youtube|EHYBCzXclFE}}
-- to break this down, first, you call the parser function with#ev
(which easily stands for embed video) and then a colon to introduce the service where the video is coming from. - This example is from YouTube. Other popular video services are also available for embedding. For a full list, see the extension page from MediaWiki's site.
- The service name is followed by a pipe (
|
) and then the video's unique identifier. - If you're not sure how to find the identifier, here is how. Go to the video's page (
https://www.youtube.com/watch?v=EHYBCzXclFE
in our example ) and look at the URL in the address bar. Everything after the equals sign (=
) is the identifier for this video. Add this after the pipe. Everything goes in between two sets of curly brackets ({{
and}}
).
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.
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 <evlplayer /> 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 <evlplayer>
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 .
|
External links[]