Extension:EmbedVideoPlus

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
EmbedVideoPlus

Release status: beta

Implementation  Parser function
Description Adds a parser function called #evp for embedding video clips from popular video sharing services.
Author(s)  Mohammad Derakhshani (Mderakhs) (orginal author: Jim R. Wilson)
Last Version  0.1.2
MediaWiki  1.6.x, 1.9.x, 1.10.x or higher
License The MIT License
Download EmbedVideoPlus.php
Example  see the Project Homepage

check usage (experimental)

The EmbedVideoPlus Extension is a MediaWiki extension which adds a parser function called #evp for embedding video clips from popular video sharing services. EmbedVideoPlus is a fork of Extension:EmbedVideo. I added new features, including caption and align, to the Extension.

Project Homepage
EmbedVideoPlus Extension
Source Code
EmbedVideoPlus.php
Licensing
EmbedVideoPlus is released under The MIT License.

[edit] Installation

  1. Download EmbedVideoPlus, and be sure to rename the downloaded file to EmbedVideoPlus.php.
  2. Drop this script in $IP/extensions
    Note: $IP is your MediaWiki install directory.
  3. Enable the extension by adding this line to the bottom of your LocalSettings.php:
require_once('extensions/EmbedVideoPlus.php');

[edit] Usage

For example, to embed "http://www.youtube.com/watch?gl=CA&hl=en&v=VtTqpqGIIYU&feature=related", you can enter: {{#evp:youtube|VtTqpqGIIYU|Mozart concerto 20 in d, K.466 - 1. Allegro (1of2) Gulda|right}}

See the output here: http://derakhshani.org/ewiki/Extension:EmbedVideoPlus

The EmbedVideoPlus parser function expects to be called in either of the following ways:

  • {{#evp:service|id}}
  • {{#evp:service|id|description}}
  • {{#evp:service|id|description|align}}
  • {{#evp:service|id|description|align|width}}

Where:

  • service is the name of a video sharing service.
  • id is the id of the video to include
  • description (optional) is the caption of the video clips.
  • align (optional) is the align of the video clip in the page (it can be "left" or "right")
  • width (optional) is the width in pixels of the viewing area (height will be determined automatically)

[edit] Supported Services

As of version 0.1, EmbedVideoPlus supports embedding video content from the following services:

[edit] 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 {{{1}}}).

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 Template:Youtube_tn which could contain this:

<div class="thumb tright">
{{#evp:youtube|{{{1}}}|{{{2|100}}}}}
</div>

And then call it like this:

{{youtube tn|someYoutubeId}}