Extension:MultimediaPlayer

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg
MultimediaPlayer

Release status:Extension status beta

ImplementationTemplate:Extension#type Tag, Parser function
DescriptionTemplate:Extension#description Plays a list of multimedia files
Author(s)Template:Extension#username Ike Hecht (tosfostalk)
Latest versionTemplate:Extension#version 0.3.3 (September 2014)
MediaWikiTemplate:Extension#mediawiki > 1.23, likely earlier versions as well
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
ParametersTemplate:Extension#parameters

$wgMultimediaPlayerSources $wgMultimediaPlayerKnownSources

TagsTemplate:Extension#tags
multimediacontainer
Hooks usedTemplate:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
BeforePageDisplayManual:Hooks/BeforePageDisplay

Translate the MultimediaPlayer extension if it is available at translatewiki.net

Check usage and version matrix.

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 place the file(s) in a directory called MultimediaPlayer in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/MultimediaPlayer/MultimediaPlayer.php";
    
  • YesY 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}}