Extension:MediawikiPlayer

The MediawikiPlayer extension embeds the JW FLV Media Player into a wiki page and supports multiple formats like FLV, MP4 (H264/AAC), MP3, Youtube-related formats, various streaming server-related formats and various XML playlists formats.

It is, however, licensed under a non-free CC BY-NC-SA license with noncommercial restrictions.

Usage
mediaURL

The argument may be any parameter or "flashvar" supported by the JW FLV Player. See the list of flashvars for more information regarding options of the JW FLV player.

Simple
http://www.yourdomain.com/mediafile.flv

Using arguments
http://www.yourdomain.com/mediafile.flv

Using a preview image
http://www.yourdomain.com/mediafile.flv

Youtube
http://www.youtube.com/watch?v=y8Kyi0WNg40

Mp3 player
(simply sets default height='20') http://www.yourdomain.com/mediafile.mp3 or without path to file File:mediafile.mp3

Media uploaded to the wiki
File:UploadedMediafile.flv

Note about flashvars with dots in the name
Beginning with 0.2.5, some flashvars, such as captions.file or logo.position can be used with MediawikiPlayer. Since Mediawiki will not recognize non-alphanumeric characters in tag parameter names, a special code has been designated to signify a dot (period) character: 00.

For example, to represent captions.file, use the following code segment

 . (dot/period) 01 => - (dash) 02 => _ (underscore) 09 => 0 (zero)

Downloads

 * MediawikiPlayer v0.3.0 - 09:25, 19 October 2010 (UTC)
 * MediawikiPlayer v0.2.5 - 12:45, 16 August 2010 (UTC)
 * MediawikiPlayer v0.2.4 - 19:51, 29 July 2010 (UTC)
 * MediawikiPlayer v0.2.3 - 10:36, 30 June 2010 (UTC)
 * MediawikiPlayer v0.2.2 - 04:11, 20 June 2010 (UTC)
 * MediawikiPlayer v0.2.1 - 05:35, 6 March 2010 (UTC)
 * MediawikiPlayer v0.2.0 - 02:03, 23 January 2010 (UTC)
 * MediawikiPlayer v0.1.0 - 15:43, 31 July 2009 (UTC)

Installation
To install this extension:


 * 1) Install MediawikiPlayer in yourwikidir/extensions/MediawikiPlayer/
 * 2) Install the following files from the JW FLV Media Player installation (available www.jwplayer.com) in yourwikidir/extensions/MediawikiPlayer/
 * 3) * player.swf
 * 4) * jwplayer.js

require_once("$IP/extensions/MediawikiPlayer/MediawikiPlayer.php");
 * 1) Add the following to LocalSettings.php:

$wgMWPlayerDefaultSettings
An array of the default settings for the player.

Default array:

$wgMWPlayerDefaultSettings = array(              'width' => '400',               'height' => '300',               'allowfullscreen' => 'true',               'backcolor' => 'eeeeee',               );

$wgMWPlayerDir
Directory where the media player flash and javascript files are located. Default is in the same folder as the MediawikiPlayer script.

Default:

$wgMWPlayerDir = '/w/extensions/MediawikiPlayer';

$wgMWPlayerConfig
An array of arrays to define multiple custom configurations.

$wgMWPlayerConfig = array(    'MyCustomConfig' => array ( 'width' => '400', 'height' => '300', 'allowfullscreen' => 'false', 'backcolor' => 'cccccc', ),   'AnotherConfig' => array (  'width' => '600', 'height' => '400', 'allowfullscreen' => 'true', 'backcolor' => '000000', ) );

To invoke one of these configurations in Mediawiki:

&lt;mediaplayer MWPlayerConfig="MyCustomConfig">http://www.example.com/mediafile.flv

$wgMWPlayerUseSWFObject
Set this value to true if you wish to use the older style embedding using swfobject.js instead of jwplayer.js. $wgMWPlayerUseSWFObject = true; You may also enable/disable this on a video by video basis. (Both swfobject.js and jwplayer.js must be installed for this to work) &lt;mediaplayer useSWF=true>http://www.example.com/mediafile.flv

Using add-ons
AddOns are extensions for MediawikiPlayer.

To enable an AddOn, place the file in the /Mediawikiplayer/AddOns folder and add the following code in LocalSettings.php AFTER you have included main MediawikiPlayer extension file

MediawikiPlayer::useAddOn('AddOnName');

PlayerPointer
Currently one AddOn is included with MediawikiPlayer: PlayerPointer, created by Anner van Hardenbroek. This AddOn allows you to use the new JWPlayer API to make the mediaplayer seek to a specific location in the media file using the videopointer oraudiopointer tags.

Example: &lt;mediaplayer>File:MyMediafile.flv&lt;/mediaplayer> &lt;videopointer>30&lt;/videopointer>

In this example, a link will be created which will seek to 30 seconds into the clip. You may also use hh:mm:ss notation.

How to configure LocalSettings.php for use with PlayerPointer: require_once( "$IP/extensions/MediawikiPlayer/MediawikiPlayer.php" ); MediawikiPlayer::useAddOn('PlayerPointer');

v.0.3.0

 * Added support for JWPlayer 5.3's jwplayer.js
 * Added AddOn support
 * Added internationalization for the File: namespace
 * Reorganized code

v.0.2.5

 * Added support for flashvars with dots in the name so that captions can be used.

v.0.2.4

 * Fixed issue where some FlashParams were showing up as FlashVariables instead.

v.0.2.3

 * Additional security fix for servers with register_globals enabled.

v.0.2.2

 * Additional XSS security errors fixed.
 * Prevented register_globals injections. All settings must be made after the require_once call in LocalSettings.php

v.0.2.1

 * Fixed a bug when loading local files stored on the wiki

v.0.2.0

 * Fixed XSS security risk.
 * Added ability to load media directly from the wiki using File:medianame.ext shortcut
 * Added ability to store various default configurations with $wgMWPlayerConfig

v.0.1.0

 * First public release