WikiFlasher

From Extension Collaborative Wiki

Jump to: navigation, search

Contents

Introduction

Using MediaWiki as a content management system (CMS) has some advantages and disadvantages. The pros are wonderful: simple syntax, flexible, community review and editing; however, there are some cons. Embeding HTML to launch flash is no fun.

The Problem

Gotta have flash; we don't want 10 lines of HTML inside our documents to do it.

A Solution

WikiFlasher -- a new tag that lets us reduce the required user input. In it's most basic form:

  <flash file="filename.swf" />

It makes use of the great javascript library, SWFObject, by Geoff Stearns. The library takes care of Flash detection, version checks, accessibility issues, etc.

Additionally, it supports defining a general player object and only needing to specify the media (mp4,mp3,flv) file to play. eg:

  <flash media="my_movie.flv" />

It will load the default player (named: Mediaplayer.swf) and pass the url of the movie specified in the variable file in the flashVars parameter.

The JW Media Player is a nice audio/video player if you need one.

Implementation

A MediaWiki extension has been created and made available.

Get your WikiFlasher!

  • browse source
  • svn checkout https://sourcecode.extension.org/svn/MediaWiki/WikiFlasher/trunk

Installation

Just include WikiFlasher.php to your LocalSettings.php file.

Configuration

Default parameters for this module can be overridden using the global array $wgWikiFlasherParameters in the LocalSettings.php file.

Example to change the minimum version requirement:

 $wgWikiFlasherParameters = array('version' => '6,0,40,0');


The AllowScriptAccess parameter of the Macromedia Flash Player controls the ability to perform outbound scripting from within a Flash SWF. This feature requires Flash Player 6,0,40,0 or later.

See Google for more information on this parameter.

The script policy is set to a default to allow always.

You can make changes in the LocalSettings.php file. eg:

 define('WIKIFLASHER_ALLOW_SCRIPT_ACCESS', 'sameDomain');

Usage

Load a movie (that has been uploaded to MW) and add a caption:

   <flash file="foo.swf">wiki foo movie</flash>

Load a movie that exists elsewhere on the same server:

   <flash file="/movies/foo.swf">non-wiki foo movie</flash>

Load a movie, but do not play immediately:

    <flash file="moovie.swf" play=false />

Play a FLV movie with the default player, specify a background color and a caption for the movie:

    <flash file="moon_phases.swf" bgcolor="#000000">Moon Phases</flash>

Video Player Support

So you wanna be like Google eh? Set-up a player SWF and feed it FLV files? Ok.

By default the extension will make use of a Mediaplayer.swf file as uploaded into MediaWiki. The player should take a parameter, file, which specifies the URI of the media file.

Uploading a player that meets those specs (filename and argument name), you can use the media parameter to pass the name of the FLV to the player. eg.

   <flash media="boo.flv">Play my FLV please.</flash>

Output

The flash video comes out in a DIV element with class flashcontainer. The caption is a P element contained in the former DIV with class description.

eg:

   <div class="flashcontainer">
      ....
      <p class="description">caption text</p>
   </div>

Releases

The latest, greatest and perhaps most broken is always the 'trunk version. For production systems, i would encourage users to use the tagged releases from subversion. The latest tagged releases are generally those in use by this site and others at eXtension.

See Notes below for updates.

Bugs

Anyone is welcome to report bugs to eXtensionBugs@extension.org

Notes

  • release date - svn_tag - description
  • 2007.12.07 - 0.2.0 - updates to handle audio and video via JW Media Player
  • 2006.11.14 - 0.1.9 - bug-fix for handling multiple flash tags on the same page
  • 2006.10.18 - 0.1.8 - another bug-fix for flashVars
  • 2006.08.30 - 0.1.7 - bug-fix for using flashVars in globals settings and in page
  • 2006.08.24 - 0.1.6 - bug-fix for using other MW action params, eg. purge
  • 2006.08.24 - 0.1.5 - bug-fix for video magic
  • 2006.08.24 - 0.1.4 - handle multiple movies in a page properly
  • 2006.08.24 - 0.1.3 - now SWFObject 1.4.4 enabled
  • 2006.08.23 - 0.1.2 - first public release
  • 2006.08.22 - 0.1.1 - first deployed release
Personal tools