Extension:EmbedVideo

The EmbedVideo extension adds a parser function called  for embedding video clips from over 24 popular video sharing services in multiple languages and countries. It also adds video and audio media handlers to support transforming standard file links into embedded HTML5 and tags.


 * 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.

Media Handler
For locally uploaded content the process for displaying it on a page is the same as an image. See the image syntax documentation on MediaWiki.org for complete reference on this feature.

This example would display a video in page using a HTML5 ` ` tag.



To specify the start and end timestamps in the media use the start and end parameters. The timestamp can be formatted as one of: ss, :ss, mm:ss, hh:mm:ss, or dd:hh:mm:ss.



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

- Classic Parser Tag


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

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

- Parser Tag for URLs
The #evu parser tag is like the #evt tag, but its first parameter is a URL that will be parsed to determine the service automatically.

- 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

Alternativly, you can also use the service id as the tag (assuming another extension isn't already using this tag).

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

Examples


For example, a video from YouTube uses the 'youtube' service selector. You can specify either the raw ID: Or specify 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

URL arguments can be used to chop up a video and loop it: https://www.youtube.com/watch?v=pSsYTj9kCHE&start=160&end=180&loop=1

= 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 &lt;vplayer /&gt; specifies where the player should appear within the page, and the parser function allows creation of links that load a specific video.

- Tag Hook for Video Container
Note that the use of the  tag is also acceptable here for backwards compatibility.

This evlplayer tag is used to position the video player container within the page.

&lt;vplayer id=&quot;player id&quot; w=&quot;width&quot; h=&quot;height&quot; class=&quot;class&quot; style=&quot;style&quot;&gt;default content&lt;/vplayer&gt;

An important caveat to make note of, is that the  and   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  or   attributes.

- Parser Function for Video Links
Note that the use of the  parser function is also acceptable here for backwards compatibility.

In addition to all of the attributes supported by the  tag, these specific attributes apply to the   (and  ) tags. To maintain backwards compatibility, if you do not define a  then   is assumed.

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

Version history

 * v2.7.1
 * Fixed issue with youku videos not embedding properly on https enabled wikis.


 * v2.7.0
 * Added SoundCloud support
 * Added ability to use service name as a parser tag (if not defined previously)


 * v2.6.1
 * Added new configuration options to disable adding media handlers and file extensions.
 * https://github.com/HydraWiki/mediawiki-embedvideo/issues/76
 * Fixed an uninitialized array.
 * https://github.com/HydraWiki/mediawiki-embedvideo/issues/77
 * Fixed undefined indexes in the AudioHandler class.
 * https://github.com/HydraWiki/mediawiki-embedvideo/issues/78
 * Fixed class properties that were unintentionally declared as static.
 * https://github.com/HydraWiki/mediawiki-embedvideo/issues/75
 * Fixed RTL language issues with CSS.
 * https://github.com/HydraWiki/mediawiki-embedvideo/pull/73


 * v2.6.0
 * Added support for vertically aligning videos.
 * Improved sizing of video and audio tags in Chrome and Firefox when using the media handler tags.
 * Fixed an undefined variable.
 * https://github.com/HydraWiki/mediawiki-embedvideo/issues/71


 * v2.5.2
 * If ffmpeg is not installed on the server the FFProbe class will no longer attempt to use and instead just return generic descriptions.
 * Fixed properties on FFProbe being incorrectly declared as static.
 * Fixed issues with not returning generic descriptions when the local file being accessed by ffprobe is not readable.


 * v2.5.1
 * Added URL argument support to Twitch services.


 * v2.5.0
 * Added support for VideoLink tags
 * Support for Disclose.tv added
 * Twitch VOD support updated.
 * Added #evu parser tag


 * v2.4.1
 * Merged Sophivorus' improvements and fixes.
 * Support for TubiTV.com with the tubitv service identifier.
 * Fixed vimeo aspect ratio.
 * Fixed dailymotion ID regex.
 * Fixed error messages being double parsed.


 * v2.4.0
 * New media handlers to embed locally uploaded video and audio files.
 * Requires ffmpeg and ffprobe binaries to be installed.
 * Uses HTML5 and tags.
 * Two new settings:
 * $wgFFmpegLocation - Set the location of the ffmpeg binary.
 * $wgFFprobeLocation - Set the location of the ffprobe binary.


 * v2.3.3
 * Support for JW Player.


 * v2.3.2
 * Fix auto resize breaking when leaving full screen.


 * v2.3.1
 * Fixed issue #54 (EmbedVideo doesn't work with mw-collapsible class)
 * Fixed issue #50 ("arg" should be "args" in addService)
 * Added "inline" alignment option
 * Fixed center alignment option css
 * Auto Resize now targets mobile as well


 * v2.3.0
 * Hard cut off of support for versions older then MediaWiki 1.25
 * Auto Resize attribute added
 * Reverted array_key_exists regression to fix the ` ` tag being broken.


 * v2.2.9
 * Fixed issue with Twitch.tv switching over to HTTPS.
 * Added support for http://media.ccc.de
 * New services can now be added from other extensions programmatically.


 * v2.2.8
 * Support for Daum TVPot
 * Fix for URL arguments for youtube and youtubeplaylist.
 * Support for Beam.pro.
 * Support for Hitbox.tv.


 * v2.2.7
 * Compatible with MediaWiki 1.24.0+


 * v2.2.6
 * NicoNico Video ID fixes; will work with new ID formats.


 * v2.2.5
 * XSS flaws reported by Mischanix.


 * v2.2.4
 * Fix Bing to work with their new URLs.
 * Remove MSN as their new video service does not support embedding.
 * Standardize Tudou support per their wiki.


 * v2.2.3
 * Added support for Youku and Tudou.


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


 * v2.2.1
 * 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
 * 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.0
 * 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
 * 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 / French / German