Aide:Extension MediaWikiPlayer

De plongeplo
Révision datée du 2 mai 2017 à 20:20 par Pierrot tk (discussion | contributions)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigation Aller à la recherche


Information repris tel quel sur le site : http://wiki.swiftlytilting.com/MediawikiPlayer

MediawikiPlayer embeds the JW FLV Media Player into a wiki page.

The JW FLV Media Player supports the following formats:

  • FLV
  • MP4 (H264/AAC)
  • MP3
  • Youtube
  • Various streaming servers
  • Various XML playlists

Exemples

Voir aussi sur cette page : Test video

Video from Youtube

<mediaplayer>http://www.youtube.com/watch?v=y8Kyi0WNg40</mediaplayer>

<videopointer>2</videopointer>

Local Mp3 File

<mp3player >File:Quack.mp3</mp3player>

Usage

<mediaplayer argument=value >mediaURL</mediaplayer>

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

<mediaplayer>http://www.yourdomain.com/mediafile.flv</mediaplayer>

Using arguments

<mediaplayer width='500' height='300'>http://www.yourdomain.com/mediafile.flv</mediaplayer>

Using a preview image

<nowiki><mediaplayer image='http://domain.com/image.jpg'>http://www.yourdomain.com/mediafile.flv</mediaplayer></nowiki>

Youtube

<mediaplayer>http://www.youtube.com/watch?v=y8Kyi0WNg40</mediaplayer>

Mp3 player

(simply sets default height='20')

<mp3player>http://www.yourdomain.com/mediafile.mp3</mp3player>

Media uploaded to the Wiki

<mediaplayer>File:UploadedMediafile.flv</mediaplayer>

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 from this site) in yourwikidir/extensions/MediawikiPlayer/
    • player.swf
    • yt.swf (required for youtube support)
    • swfobject.js
  3. Add the following to LocalSettings.php:
require_once("$IP/extensions/MediawikiPlayer/MediawikiPlayer.php");

Configuration parameters

$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. You don't

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:

<mediaplayer MWPlayerConfig="MyCustomConfig">http://www.yourdomain.com/mediafile.flv</mediaplayer>

Change Log

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