Extension:MultimediaPlayer

From mediawiki.org
MediaWiki extensions manual
MultimediaPlayer
Release status: unmaintained
Implementation Tag , Parser function
Description Plays a list of multimedia files
Author(s) Ike Hecht (tosfostalk)
Latest version 0.3.3 (September 2014)
MediaWiki 1.23+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download

  • $wgMultimediaPlayerSources
  • $wgMultimediaPlayerKnownSources
multimediacontainer
Quarterly downloads 11 (Ranked 131st)
Translate the MultimediaPlayer extension if it is available at translatewiki.net

The MultimediaPlayer plays a list of multimedia files. It is intended for use with multimedia items hosted by an external service - not stored in the wiki.

It creates one player per page and allows users to load that player by choosing an item from a list. Out-of-the-box support is provided for DailyMotion, Instagram, SoundCloud, YouTube, Vimeo and Vine. Admins can also add additional sources to their LocalSettings.php. For mobile compatibility, the player acts responsively where possible.

Installation[edit]

  • Download and move the extracted MultimediaPlayer folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaPlayer
  • Add the following code at the bottom of your LocalSettings.php file:
    require_once "$IP/extensions/MultimediaPlayer/MultimediaPlayer.php";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters (advanced)[edit]

$wgMultimediaPlayerSources
Expects an array (key=>value) where:
  • key is the name of a source, to be included as the first argument to the #multimediaitem parser function
  • value is the code to render that source, with $1 as a placeholder for the item's id, which is also the second argument to the #multimediaitem parser function
For example, to include YouTube as a source:
$wgMultimediaPlayerSources = array( 
     'YouTube' => '<iframe width="560" height="315" src="//www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'
);
(This is for illustration. The extension already has built-in support for YouTube.)
$wgMultimediaPlayerKnownSources
List of keys for the default sources that will be loaded. This is mainly here so that admins can remove sources that they do not want supported in their wiki.
For example, to disable all known sources other than YouTube:
$wgMultimediaPlayerKnownSources = array( 'YouTube' );

Usage[edit]

Include the player[edit]

Include the player on the page by inserting <multimediacontainer /> where desired. Note that the container will take up the entire width of its parent element. So you may want to put it in a div. See the example below.

Include some items[edit]

Include items on the page by inserting {{#multimediaitem:SourceName|ItemID|LinkText}}.

Example[edit]

After installing, you can test your installation by creating a page and inserting the following code:

<div style="max-width: 750px"><multimediacontainer /></div>

* {{#multimediaitem:DailyMotion|xmzl5|DailyMotion test}}
* {{#multimediaitem:Instagram|HNZIJuy-rt|Instagram test}}
* {{#multimediaitem:SoundCloud|16040214|SoundCloud test}}
* {{#multimediaitem:YouTube|DWef69ItVrU|YouTube test}}
* {{#multimediaitem:Vimeo|8758454|Vimeo test}}
* {{#multimediaitem:Vine|bjHh0zHdgZT|Vine test}}

See also[edit]