Extension:VideoFlv

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

Release status: stable

Implementation Tag
Description Cette extension permet de la diffusion de vidéo de type flv.
Author(s) Dominique MURA
Last version 1.0
MediaWiki MW 1.13.2
License GPL
Download see below

Check usage (experimental)

Contents

[edit] What can this extension do?

Cette extension permet d'afficher des vidéos de type flv.

This extension permits one to include FLV videos in an article.

[edit] Usage

  1. <VideoFlv width="640" height="380" >Image:MaVideo.flv</VideoFlv>
  2. <VideoFlv width="640" height="380" >/repertoire/MaVideo.flv</VideoFlv>
  3. <VideoFlv width="640" height="380" >http://www.monsite.com/repertoire/MaVideo.flv</VideoFlv>

[edit] Download instructions

Copier coller les fichiers VideoFlv.php; player_flv_maxi.txt; player_flv_maxi.swf dans le répertoire /mediawiki/extesions/VideoFlv

Copy the files VideoFlv.php and player_flv_maxi.txt (see below) and download the player_flv_maxi.swf (link below).

[edit] Installation

  1. Créer un répertoire /mediawiki/extensions/VideoFlv
  2. Copier le fichier VideoFlv.php
  3. Copier le fichier player_flv_maxi.txt
  4. Copier le fichier player_flv_maxi.swf http://flv-player.net/medias/player_flv_maxi.swf
require_once("extensions/VideoFlv/VideoFlv.php");

à la fin de LocalSettings.php.


  1. Create a directory /mediawiki/extensions/VideoFlv
  2. Copy the file VideoFlv.php (source below) into this directory
  3. Copy the file player_flv_maxi.txt (source below) into this directory
  4. Download the file player_flv_maxi.swf from http://flv-player.net/medias/player_flv_maxi.swf and place it into this directory.

Add:

require_once("extensions/VideoFlv/VideoFlv.php");

to the end of LocalSettings.php.


[edit] Configuration parameters

[edit] User rights

[edit] Code

[edit] Fichier : VideoFlv.php

<?php
$wgExtensionCredits['parserhook'][] = array(
    'name'         => 'VideoFlv',
    'version'      => '1.0',
    'author'       => 'Dominique MURA', 
    'url'          => 'http://www.mediawiki.org/wiki/Extension:VideoFlv',
    'description'  => 'Extension pour afficher des videos de type flv'
);
 
$wgExtensionFunctions[] = 'efVideoFlvSetup';
 
function efVideoFlvSetup() {
        global $wgParser;
        $wgParser->setHook( 'VideoFlv', 'efVideoFlvRender' );
}
 
function efVideoFlvRender( $input, $args, $parser ) {
#     global $wgServer, $wgScriptPath;
#      $IP = dirname(__FILE__);
 global $wgScriptPath;
        $attr = array();    
#-------------------------------------
 $width = isset($args['width']) ? $args['width'] : '640';
        $height = isset($args['height']) ? $args['height'] : '380';
#-------------------------------------
 $chemin = $wgScriptPath . "/extensions/VideoFlv/"; 
        $swf = $chemin . 'player_flv_maxi.swf';
        $config = $chemin . 'player_flv_maxi.txt';
#-------------------------------------
 $title = Title::makeTitleSafe("Image",$input);
        $image = new Image($title);
        $flv = $image->getViewURL(false);
        if( !$image->exists() ) {
            $flv = $input;
        }
#--------------------------------------
# http://flv-player.net/
#--------------------------------------
#<object type="application/x-shockwave-flash" data="player_flv_maxi.swf" width="640" height="380">
#     <param name="movie" value="player_flv_maxi.swf" />
#     <param name="FlashVars" value="flv=LaBaguette.flv&amp;config=player_flv_maxi.txt" />
#</object>
#--------------------------------------
 $attr[] = '<object type="application/x-shockwave-flash"' . 
                'data="' . $swf . 
                '" width="' . $width . '" height="' . $height .'" >' . 
                '<param name="movie" value="' . $swf . '" />' . 
                '<param name="allowFullScreen" value="true" />'. 
                '<param name="FlashVars" value="flv=' . $flv . '&amp;config=' . $config . '" />' .
                '</object>';
 
        return implode( '<br />', $attr ) . "\n\n <br/>";
#     return implode( '<br />', $attr ) . "\n\n" . htmlspecialchars( $input ) ;
}

[edit] Fichier : player_flv_maxi.txt

autoload=1
bgcolor1=189ca8
bgcolor2=085c68
playercolor=085c68
showiconplay=1
showplayer=always
showstop=1
showtime=2
showvolume=1
volume=100
width=640
height=380
showtitleandstartimage=0
showopen=0
showfullscreen=1

[edit] See also

http://flv-player.net/

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox