Extension:FLVPlayer

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
FLVPlayer

Release status: beta

Implementation Tag
Description This extension allows the display of flv movies within a wiki using the FlowPlayer FLV movie player. FlowPlayer is under GPL licence with restrictions.
Author(s) Christopher Ottley
Latest version 1.0
License GPLv2+
Download FLVPlayer code v1.00 (latest)

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

Check usage and version matrix; code metrics

The FLVPlayer extension allows the display of flv movies within a wiki using the [1] FLV movie player.

Syntax[edit | edit source]

Base Syntax[edit | edit source]

<flvplayer width="320" height="240">filename.flv</flvplayer>

Attribute Reference[edit | edit source]

The following attribues are a subset of the configurable flashvars that is used by FlowPlayer.

  • width=px or % (Specify the width of the movie when displayed)
  • height=px or a% (Specify the height of the movie when displayed)
  • loop=true/false (Loop the movie, default:true)
  • autoplay=true/false (Automatically start playing the movie, default:false)
  • hidecontrols=true/false (Hide the controls of FlowPlayer, default:false)

Examples[edit | edit source]

<flvplayer width="400" height="400" autoplay="true" hidecontrols="true">filename.flv</flvplayer> This starts playing the movie as soon as it is available for streaming and does not show any FlowPlayer controls to the user.

<flvplayer width="400" height="400" loop="true">filename.flv</flvplayer> This automatically sets the movie in looping mode as soon as it starts playing.

Installation[edit | edit source]

  1. Download the latest version of the code
  2. Copy the code into a file named FLVPlayer.php
  3. Save the file in the extensions/flvplayer directory of your mediawiki folder
  4. Add the line include('extensions/flvplayer/FLVPlayer.php'); to the end of your LocalSettings.php file (The name of your file is case sensitive!)
  5. Download the latest Flowplayer file from sourceforge.net (not newer than 1.8)
  6. Extract FlowPlayer.swf from the zip file and place it in the extensions/flvplayer directory of your mediawiki folder

Now you can use the extension with <flvplayer>...</flvplayer> in the wiki. NOTE: To download older versions I am providing the fallowing link. [2]

Frequently Asked Questions[edit | edit source]

I can't upload Flash movie (*.flv) files![edit | edit source]

If you cannot upload anything, then first enable uploads. Find the line #$wgDisableUploads = false; in LocalSettings.php and uncomment it.

Notice : Line became $wgEnableUploads = false;. Must be set to 'true'. (v1.9.3)

By default, Mediawiki still blocks many files from being uploaded for security reasons. Add this line your LocalSettings.php file, which will allow the upload of FLV files:

$wgFileExtensions[] = 'flv';

See also Help:Images and other uploads: You may also need to remove the desired extension from the filetype blacklist in /includes/DefaultSettings.php.

There may also be an issue with the Mime Type Filter. If you still cannot upload flv files, try adding $wgVerifyMimeType= false; in LocalSettings.php.

As an alternative, you can modify the script (FLVPlayer.php) to allow you to link to outside flv files:

  /* Generate final code */
  function render() {
    $isUrl = ( strstr($this->file,'http://') == $this->file );
    if($isUrl){
        $this->url = $this->file;
    }else{
        $this->url = $this->getViewPath($this->file);
    }
 
    $this->code = '<object type="application/x-shockwave-flash" data="' . $this->flowplayerpath . '" width="' . $this->width . '" height="' . $this->height . '" id="FlowPlayer"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' . $this->flowplayerpath . '" /><param name="quality" value="high" /><param name="scale" value="noScale" /><param name="wmode" value="transparent" /><param name="flashvars" value="videoFile=' . $this->url . '&baseURL=http://' . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $this->flashvars . '" /></object>';
 
    return $this->code;
  }

Now you should be able to write:

<flvplayer width="400" height="400" loop="true">http://path.to.server/filename.flv</flvplayer>