Template:EmbedVideo/doc: Difference between revisions
dev>Pppery {{ExtensionDependencies|EmbedVideo}} |
imported>GothicDivaXX m 1 revision imported from dev:Template:EmbedVideo/doc |
||
(No difference)
| |||
Latest revision as of 05:17, 21 July 2025
Description
For this template to work properly you may need to enable this extension at Special:ManageWiki/extensions#mw-section-parserhooks.
This template embeds a video from external sources like YouTube or Twitch, using mw:Extension:EmbedVideo (fork).
Syntax
Template uses unnamed parameters. Video service name and video's ID from the URL are the main parameters, examples (copied from extension documentation):
In simplest case without additional parameters the video will be 300px in width and placed to the right side of the of the page:
{{EmbedVideo|service|ID}}
All parameters:
{{EmbedVideo|service|ID|width|alignment|title|description}}
Usage example
Simple code:
{{EmbedVideo|youtube|9xJfPx8RViU}}
With all parameters:
{{EmbedVideo|youtube|J---aiyznGQ|500|left|Keyboard cat! - THE ORIGINAL!|This is second example}}
The width value must be just number; the alignment values are "left" and "center" ("right" is default thus can be skipped).
To skip a parameter, leave its position blank, for example default width and no title are alright but different alignment is needed:
{{EmbedVideo|youtube|SaA_cs4WZHM||left||This is third example}}
Results:
This is second example
This is third example
Notes
These are notes provided by Miraheze Developers Wiki (they can be removed after import):
- When importing this template to another wiki, you should enable extension EmbedVideo at Special:ManageWiki/extensions#mw-section-mediahandlers.
- Upon import to another wiki the title can be changed to whatever user prefers, so use that title instead of "EmbedVideo" in its syntax.
- See also:
- Template:YouTube - another video embed template which supports only YouTube and uses different extension.
- Template:Flexbox - this template can be used to create a gallery of videos.