Extension:VideoFlash

VideoFlash VideoFlash is an extension that displays videos from Youtube, GoogleVideo, Dailymotion, sevenload and similar services based on FLV video format.

This extension is based on Extension:YouTube (Iubito) extension.

Source
Copy the following code into extensions/videoflash.php :

<?php

/*******************************************************************************
 * VideoFlash Extension by Alberto Sarullo, based on YouTube (Iubito) extension *
 * http://www.mediawiki.org/wiki/Extension:VideoFlash                          *
 * Tag :                                                                       *
 * v                                                *
 * Ex :                                                                        *
 * from url http://www.youtube.com/watch?v=4lhyH5TsuPg                       *
 * 4lhyH5TsuPg                                      *
 * Ex:                                                                         *
 * from url http://video.google.it/videoplay?docid=1811233136844420765       *
 * 1811233136844420765           *
 * Ex:                                                                         *
 * from url http://en.sevenload.com/videos/7DQGFhH/Sexy-Tussis               *
 * 7DQGFhH                         *
 * from url http://video.google.it/videoplay?docid=1811233136844420765       *
 * 1811233136844420765           *
 * Ex:                                                                         *
 * from url http://en.sevenload.com/videos/7DQGFhH/Sexy-Tussis               *
 * 7DQGFhH                         *
 * 7DQGFhH                         *

$wgExtensionFunctions[] = 'wfVideoFlash'; $wgExtensionCredits['parserhook'][] = array(       'name' => 'VideoFlash',        'description' => 'VideoFlash (YouTube, GoogleVideo, Dailymotion, sevenload...)',        'author' => 'Alberto Sarullo',        'url' => 'http://www.mediawiki.org/wiki/Extension:VideoFlash' );

function wfVideoFlash { global $wgParser; $wgParser->setHook('videoflash', 'renderVideoFlash'); }

function renderVideoFlash($input, $args) { $type = "youtube"; $params = explode ("|", $input); $id = $params[0]; $width = 425; $height = 350; $style = ''; $url['youtube']    = 'http://www.youtube.com/v/'.$id; $url['googlevideo'] = 'http://video.google.com/googleplayer.swf?docId='.$id; $url['dailymotion'] = 'http://www.dailymotion.com/swf/'.$id; $url['sevenload']  = 'http://en.sevenload.com/pl/'. $id .'/'. $width .'x'. $height .'/swf'; // add here other similar services
 * 1) The callback function for converting the input text to HTML output

if(count($args)>0 && $args['type'] && $url[$args['type']]){ $type = $args['type']; }

if (count($params) > 1) { $width = $params[1]; if (count($params) > 2) { $height = $params[2]; if (count($params) > 3) { $style = $params[3]; }          }        }        $output='' .' ' .' ' .' ';        return $output; }

?>

Installation
require_once("extensions/videoflash.php");
 * Create the file videoflash.php and paste the code shown above.
 * Upload videoflash.php to your wiki/extension directory.
 * Add the following lines at the end of LocalSettings.php:

Youtube
Original url: http://www.youtube.com/watch?v=4lhyH5TsuPg

Wiki code:

4lhyH5TsuPg

or (with width and height):

WZpeeRSk-0A|200|100

GoogleVideo
Original url: http://video.google.it/videoplay?docid=1811233136844420765

Wiki code:

1811233136844420765

or (with width and height):

1811233136844420765|200|150

DailyMotion
Original url: http://www.dailymotion.com/video/xtnps_pixar-geris-game

Wiki code: 3yjEngoVxQ3rd5NYI

or (with width and height):

3yjEngoVxQ3rd5NYI|640|480

sevenload
Original url: http://en.sevenload.com/videos/Eh4mjir/Bewegungen-der-Natur

Wiki code: Eh4mjir

or (with width and height):

Eh4mjir|640|480

Authors

 * Alberto Sarullo, main developer. - Website
 * CeLe - english teacher ;)

MediaWiki Version

 * Successfully tested on MediaWiki 1.6.9 and MediaWiki 1.8.4.

Full Screen
/*******************************************************************************
 * Simple "View in fullscreen" addon by xiandos.info.                          *
 * At the end, before the output is returned, add:                             *
 * At the end, before the output is returned, add:                             *
 * At the end, before the output is returned, add:                             *

if (strstr($type, "googlevideo")){ $output .= ' View the video in fullscreen '; }

return $output;

Wikis using videoflash
If you use this extension, please add your website here.


 * GreatCuba.com Cuba Travel Wiki
 * aessenet.org wiki
 * Quadratus.ws
 * xiandos.info (example)
 * Dikt (Norwegian)