wikifab / embed-video
Installs: 2 969
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 52
Type:mediawiki-extension
This package is auto-updated.
Last update: 2024-10-20 23:15:38 UTC
README
#About
The EmbedVideo Extension is a MediaWiki extension which adds a parser function called #ev for embedding video clips from over 22 popular video sharing services in multiple languages and countries. It also adds video and audio media handlers to support transforming standard [[File:Example.mp4]]
file links into embedded HTML5 <video>
and <audio>
tags.
For more information about EmbedVideo, to download, to contribute, and to report bugs and problems, visit the GitHub project page:
https://github.com/HydraWiki/mediawiki-embedvideo
Issues, bug reports, and feature requests may be created at the issue tracker:
https://github.com/HydraWiki/mediawiki-embedvideo/issues
The MediaWiki extension page is located at:
https://www.mediawiki.org/wiki/Extension:EmbedVideo
##History
The original version of EmbedVideo was created by Jim R. Wilson. That version was later forked by Mohammed Derakhshani as the EmbedVideoPlus extension. In early 2010 Andrew Whitworth took over active maintenance of both extensions and merged them together as "EmbedVideo". Much later on in September 2014 Alexia E. Smith forcefully took over being unable to contact a current maintainer.
The newer versions of EmbedVideo are intended to be fully backwards-compatible with both older EmbedVideo and EmbedVideoPlus extensions.
#License
EmbedVideo is released under the MIT license
http://www.opensource.org/licenses/mit-license.php
See LICENSE for more details
#Installation
##Download
There are three places to download the EmbedVideo extension. The first is directly from its GitHub project page, where active development takes place. If you have git, you can use this incantation to check out a read-only copy of the extension source:
git clone https://github.com/HydraWiki/mediawiki-embedvideo.git
Downloadable archive packages for numbered releases will also be available from the github project page.
##Installation Instructions
- Download the contents of the extension, as outlined above.
- Create an EmbedVideo folder in the extensions/ folder of your MediaWiki installation.
- Copy the contents of this distribution into that folder
For Mediawiki 1.19 through 1.23 add the following line to your LocalSettings.php:
require_once("$IP/extensions/EmbedVideo/EmbedVideo.php");
For Mediawiki 1.24 and up add the following line to your LocalSettings.php:
wfLoadExtension("EmbedVideo");
#Usage
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 <video>
tag.
[[File:Example.mp4]]
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.
[[File:Example.mp4|start=2|end=6]]
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}}
However, if needed optional arguments may be left blank by not putting anything between the pipes:
{{#ev:service|id|||description}}
#evt - Parser Tag for Templates
The #evt parser tag allows for key=value pairs which allows for easier templating and readability.
{{#evt:
service=youtube
|id=https://www.youtube.com/watch?v=pSsYTj9kCHE
|alignment=right
}}
#evu - 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.
{{#evu:https://www.youtube.com/watch?v=pSsYTj9kCHE
|alignment=right
}}
<embedvideo> - Tag Hook
Videos can easily be embedded with the <embedvideo></embedvideo> tag hook. The ID/URL goes as the input between the tags and parameters can be added as the tag arguments.
<embedvideo service="youtube">https://www.youtube.com/watch?v=pSsYTj9kCHE</embedvideo>
Attributes for Parser Tags
Examples
Example #1
For example, a video from YouTube use the 'youtube' service selector enter either the raw ID:
{{#ev:youtube|pSsYTj9kCHE}}
Or the full URL:
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE}}
Example #2
To display the same video as a right aligned large thumbnail with a description:
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|1000|right|Let eet GO|frame}}
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
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=76}}
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 <vplayer /> 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 <vplayer>
tag is also acceptable here for backwards compatibility.
This evlplayer tag is used to position the video player container within the page.
<vplayer id="player id" w="width" h="height" class="class" style="style">default content</vplayer>
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.
Supported Services
As of version 2.x, EmbedVideo supports embedding video content from the following services:
#Configuration Settings
#Credits
The original version of EmbedVideo was written by Jim R. Wilson. Additional major upgrades made by Andrew Whitworth, Alexia E. Smith, and other contributors.
See CREDITS for details