EmbedVideo Extension

From Jimbojw.com

Jump to: navigation, search

The EmbedVideo Extension is a MediaWiki extension which adds a parser function called #ev for embedding flash based video content into wiki pages.

It is released under The MIT License.

Note: If you're looking for a German version of this page, check out Hilfe:Video on krefeldwiki.de

Contents

Compatibility

This extension requires:

  • MediaWiki 1.6.x, 1.9.x, 1.10.x or higher
  • PHP 4.x, 5.x or higher

Installation

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

Configuration

Note: All instructions in this section are strictly Optional

The following global variables may be specified in LocalSettings.php AFTER the require_once() call to activate the extension.

Global Purpose Default
$wgEmbedVideoMinWidth Defines the minimum acceptable width in pixels for embedded videos. 100
$wgEmbedVideoMaxWidth Defines the maximum acceptable width in pixels for embedded videos. 1024

You may also configure the list of supported video sharing sites in your LocalSettings.php file. To remove an entry, add the following (AFTER the require_once() that enables the extension):

unset($wgEmbedVideoServiceList['service']);

Where 'service' is the name of the video sharing service to remove.

Alternatively, to add a new video service, add the following:

$wgEmbedVideoServiceList['service'] = array(
    'url' => 'http://somedomain.com/path/to/video/$1'
);

Where '$1' is intended be replaced by the id as provided in the parser function parameters.

Determining what the URL should be is left as an exercise for the reader.

Usage

Once installed, you (or editors of your wiki) may begin embedding videos into any article.

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

  • {{#ev:service|id}} -or-
  • {{#ev:service|id|width}}

Where:

  • service is the name of a video sharing service.
  • id is the id of the video to include
  • width (optional) is the width in pixels of the viewing area (height will be determined automatically)

Examples

YouTube

{{#ev:youtube|dMH0bHeiRNg}}

FunnyOrDie

{{#ev:funnyordie|74|200}}

Google Video

{{#ev:googlevideo|6486979190703380003}}

Dailymotion

{{#ev:dailymotion|7tE9MbSfWo9YaeNRP|300}}

sevenload

{{#ev:sevenload|Eh4mjir}}

Revver

{{#ev:revver|233330}}

Comments

Got something to say?

Leave a comment
Sorry, comments are disabled.

or, read what others have said ...