Extension:VideoFlv
|
|
WARNING: the code or configuration described here poses a major security risk.
Problem: Vulnerable to Cross-site scripting attacks, because it passes user input directly to the browser. This may lead to user accounts being hijacked, among other things. |
|
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
- <VideoFlv width="640" height="380" >Image:MaVideo.flv</VideoFlv>
- <VideoFlv width="640" height="380" >/repertoire/MaVideo.flv</VideoFlv>
- <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
- Créer un répertoire /mediawiki/extensions/VideoFlv
- Copier le fichier VideoFlv.php
- Copier le fichier player_flv_maxi.txt
- 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.
- Create a directory /mediawiki/extensions/VideoFlv
- Copy the file VideoFlv.php (source below) into this directory
- Copy the file player_flv_maxi.txt (source below) into this directory
- 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&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 . '&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
