Extension:EmbedVideo

The EmbedVideo Extension is a MediaWiki extension which adds a parser function called #ev for embedding video clips from over 24 popular video sharing services in multiple languages and countries.


 * Project Homepage: Documentation at Github
 * Source Code: Source code at Github
 * Bugs:issues at Github
 * Licensing: EmbedVideo is released under The MIT License.

Notice: As of the 2.x series the EmbedVideo extension has a new maintainer and an entirely rewritten code base. It retains backwards compatibility with EmbedVideo 1.0 and EmbedVideoPlus.

Tags
The EmbedVideo parser function expects to be called in any of the following ways:

#ev - Classic Parser Tag


However, if needed optional arguments may be left blank by not putting anything between the pipes:

#evt - Parser Tag for Templates
The #evt parser tag allows for key=value pairs which allows for easier templating and readability.

- Tag Hook
Videos can easily be embedded with the tag hook. The ID/URL goes as the input between the tags and parameters can be added as the tag arguments.

https://www.youtube.com/watch?v=pSsYTj9kCHE

Examples


For example, a video from YouTube use the 'youtube' service selector enter either the raw ID: Or the full URL:



To display the same video as a right aligned large thumbnail with a description:

For YouTube to have the video start at a specific time code utilize the urlargs(URL arguments) parameter. Take the rest of the URL arguments from the custom URL and place them into the urlargs. Please note that not all video services support extra URL arguments or may have different keys for their URL arguments. https://www.youtube.com/watch?v=pSsYTj9kCHE&start=76

Supported Services
As of version 2.x, EmbedVideo supports embedding video content from the following services:

v2.2.3 Patch Notes

 * Added support for Youku and Tudou.

v2.2.2 Patch Notes

 * Updated regular expression replacement pattern for Twitch URLs. Old Twitch embed URLs do not automatically redirect.

v2.2.1 Patch Notes

 * Fixed E_NOTICE being thrown for undefined array indexes.
 * Back ported some PHP 5.3 compatibility changes. Please note that future releases of EmbedVideo may not support PHP 5.3 as it is an outdated version.  Upgrading to PHP 5.4 at a minimum is recommended.

v2.2.0 Patch Notes

 * Fixed a bug with alignment that would cause the left align to not work similar to how Mediawiki handles images and other media.
 * New parser tag better suited for templates; #evt.
 * New HTML like tag format that can take parameters.

v2.1.8 Patch Notes

 * Translations updated.
 * Fixed a PHP notice being thrown for the new mobile check.

v2.1.7 Patch Notes

 * German translation thanks to User:Messerjokke79.

v2.1.6 Patch Notes

 * Added to the ability to add optional URL arguments to the generated embed URL.

v2.1.5 Patch Notes

 * Fixed context in which resource modules are loaded. This resolves an issue with CSS not always applying.

v2.1.4 Patch Notes

 * Problem with Dailymotion videos // EmbedVideo 2.1.3 (running on MediaWiki 1.23.5) Thanks to Pierre-Yves for reporting this issue.

v2.1.3 Patch Notes

 * Accidental usage of PHP 5.4+ array syntax would cause a fatal error for older Mediawiki installations. Thanks to Rich Bowen for reporting and submitting a patch for this issue.
 * Fix for a CSS loading order issue on some wiki configurations.

v2.1.2 Patch Notes

 * Missing CSS for right alignment on the default container.
 * Parameters were not being reset between parses.

v2.1.1 Patch Notes

 * Fixed a logic issue where the $wgEmbedVideoDefaultWidth global override was not obeyed if the video service specified a default width.
 * Actually bumped the version number this time.

v2.1 Patch Notes

 * The width parameter was changed to dimensions. See parameter documentation above.
 * New container parameter to use a standard Mediawiki thumb frame or default to a generic container.
 * The description parameter no longer forces the thumb frame to be used.
 * Added support for Archive.org, Blip.tv, CollegeHumor, Gfycat, Nico Nico Video, TED Talks, and Vine.
 * Ability to center align embeds.
 * CSS resource module.

v2.0 Patch Notes

 * URLs from the player pages that contain the raw video ID can now be used as the ID parameter.
 * Validation of the raw IDs is improved.
 * Code base rewritten to have a VideoService class for future extensibility.
 * Switched to HTML5 iframes wherever possible for embeds.
 * All services overhauled to be up to date and working.
 * The 'auto' and 'center' alignment values were removed as they were not working. They are planned to be implement properly in the future.

Developer Notes
The major benefit of using a parser function as the injection mechanism for video clips (as opposed to an extension tag) is that parser functions can utilize template parameters (of the form  ).

For example, say you found yourself making a lot of YouTube videos in thumbnail size, right-aligned like an image. You might make a template called  which could contain this:

And then call it like this:

Reporting Bugs
There is an issue tracker set up on the Github project page.

Contributing
Bug reports, feature requests, and patches are always welcome. New contributors can be added to the Github project if there is sufficient interest.

Weblinks

 * Gamepedia Help Wiki
 * Live demo at Wikimini, encyclopedia written by children
 * German description of usage