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 GitLab
 * Source Code: Source code at GitLab
 * Bugs:Issues at GitLab
 * Licensing: EmbedVideo is released under The MIT License.


 * GDPR-conform Forge: Source code at GitLab - focuses on a more privacy centric version of EmbedVideo. Note that only youtube, spotify, vimeo and archive.org is supported And every parser function but #ev is removed

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

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

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=eAORm-8b1Eg&start=76

URL arguments can be used to chop up a video and loop it: https://www.youtube.com/watch?v=eAORm-8b1Eg&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;evlplayer /&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.

A default video can be set to fill the container by default instead of default content as well.

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.

Video link examples
Creating a video list allows video links to create a playlist on the fly using the youtube and youtubevideolist service. Note: even if you define a service the system will use youtube if a list of videos is provided.

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

Version history

 * v2.9.0
 * Fix stored XSS in AudioTransformOutput and VideoTransformOutput.
 * Fix autoResize on mobile.
 * Fix video caption escaping the container.
 * Handle multiple video sizes per page in resize.
 * Move beam service to mixer.
 * Add a default link title for #evl/#vlink.
 * Add spotify playlist embeds.
 * Add facebook video embeds.
 * Fix centering of videos.
 * Add Microsoft Stream service.
 * Add title to iframes.
 * Add API help messages for 1.33 compatibility.
 * Fix static analysis issues.
 * Fix Twitch embeds.


 * v2.8.0
 * Renamed hitbox.tv to smashcast.tv.
 * Updated Nico Video embed code.
 * Added support for Twitch clips.
 * Fix issues with Twitch VODs.
 * Removed unused $wgFFmpegLocation that was interferring with TimedMediaHandler.
 * Added Polish translation.


 * v2.7.4
 * Added support for playlist to evlplayer
 * Added support for youtube video list
 * Updated Documentation for evlplayer
 * Added missing dependency for evlplayer in extension.json


 * v2.7.3
 * Default Twitch VOD to autoplay=false by default
 * Allow videos to be sized in 1:1 aspect ratios for special use cases.


 * v2.7.2
 * Added feature to evlplayer to allow default video content


 * 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://gitlab.com/hydrawiki/extensions/EmbedVideo/issues/76
 * Fixed an uninitialized array.
 * https://gitlab.com/hydrawiki/extensions/EmbedVideo/issues/77
 * Fixed undefined indexes in the AudioHandler class.
 * https://gitlab.com/hydrawiki/extensions/EmbedVideo/issues/78
 * Fixed class properties that were unintentionally declared as static.
 * https://gitlab.com/hydrawiki/extensions/EmbedVideo/issues/75
 * Fixed RTL language issues with CSS.
 * https://gitlab.com/hydrawiki/extensions/EmbedVideo/pull/73

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 GitLab project page.

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

Weblinks

 * Fandom Help Wiki / French