Open main menu


Important! - Please consider using the EmbedVideo Extension instead of this - it supports multiple video sharing sites and is syntactically and functionally superior.

MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: beta
Implementation Tag
Description VideoFlash is an extension that displays videos from YouTube, Google Video, Dailymotion, Sevenload, Revver and similar services
Author(s) Alberto Sarullo, SignpostMarv Martin, Frank Forte
Latest version 1.2.4 (2011-03-16)
MediaWiki 1.6.8+
Database changes No
License GFDL
Download see below
Translate the VideoFlash extension if it is available at
Check usage and version matrix.

VideoFlash is an extension that displays videos from YouTube, Google Video, Dailymotion, Sevenload, Revver and similar services based on FLV video format.

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


Copy the following code into extensions/videoflash.php:

*	last change: 2011-03-16
*       Available under the GFDL ( as source code was taken from
*       Modification by SignpostMarv Martin
*       html5 added by Frank Forte

$wgExtensionFunctions[] = 'wfVideoFlash';
$wgExtensionCredits['parserhook'][] = array(
	'name' => 'VideoFlash',
	'description' => 'Allows to display videos from YouTube, Google Video, Dailymotion, Sevenload, Revver and similar services',
	'author' => 'Alberto Sarullo, SignpostMarv Martin, Frank Forte',
	'version' => '1.2.4',
	'url' => ''

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

# The callback function for converting the input text to HTML output
function renderVideoFlash($input, $args) {
	// append new services to the array with the key being the intended value of the type attribute on the <videoflash> tag
	$url = array();
	$url['youtube'    ] = '$s?fs=%5$u';
	$url['googlevideo'] = '$d';
	$url['dailymotion'] = '$s';
	$url['sevenload'  ] = '$s/%2$ux%3$u/swf';
	$url['revver'     ] = '$u';
	$url['blip'       ] = '$s';
	$url['youku'      ] = '$s/.swf';
	$url['vimeo'      ] = '$d&amp;;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0';
	$url['metacafe'   ] = '$d/' . (isset($args['vid']) ? $args['vid'] : '') . '.swf';
	$url['viddler'    ] = '$s';
	$url['megavideo'  ] = '$s';
	$url['html5'  ] = '%1$s';

	// if the embed code for a service requires flashvars attributes, you can add them here
	$flashvars = array();
	$flashvars['revver'] = 'mediaId=%1$u&affiliateId=0';

	$type       = isset($args['type'],$url[$args['type']]) ? $args['type'] : 'youtube';
	$media_url  = isset($url[$type]) ? $url[$type] : $url['youtube'];
	$flash_vars = isset($flashvars[$type]) ? $flashvars[$type] : '';

	$input_array = explode('|', htmlspecialchars($input));
	$id     = current($input_array);
	$width  = (count($input_array) > 1 && is_numeric($input_array[1])) ? $input_array[1] : 425;
	$height = (count($input_array) > 2 && is_numeric($input_array[2])) ? $input_array[2] : 350;
	$fullscreen = (isset($args['fullscreen']) ? $args['fullscreen'] : 'true') === 'false' ? false : true;

		if(strtolower($type) == 'html5')
			// I recommend CSS to set the video size, i.e. <videoflash type="html5" style="width:200px;height:150px">url</videoflash>
			$output = '<video';
			foreach($args as $attribute=>$value)
				 $output .= ' '.$attribute.'="'.$value.'"';
		     $output .= '><source src="'.$id.'"></video><p style="font-size:80%;padding:0;margin:0;">(Right click to control movie)</p>';
		     return $output;
			 $output = '<object width="%2$u" height="%3$u">'
		                .' <param name="movie" value="'.$url[$type].'" />'
		                .' <param name="allowFullScreen" value="%4$s" />'
		                .' <param name="wmode" value="transparent" />'
		                .' <embed src="'.$url[$type] . '" type="application/x-shockwave-flash" wmode="transparent"'
		                .' width="%2$u" height="%3$u" allowfullscreen="%4$s"'
		                        . ' flashvars="' . $flash_vars . '"></embed></object>';
			 return sprintf($output,$id,$width,$height,$fullscreen ? 'true' : 'false', (integer)$fullscreen);


  • Create the file videoflash.php and paste the code shown above. Make sure there are no empty lines after the final php exit tag.
  • Upload videoflash.php to your $IP /extensions directory.
  • Add the following lines at the end of LocalSettings.php :



Original url:

Wiki code:


or (with width and height):



Original url:

Wiki code:

<videoflash type="googlevideo">1811233136844420765</videoflash>

or (with width and height):

<videoflash type="googlevideo">1811233136844420765|200|150</videoflash>


Original url:

Wiki code:

<videoflash type="dailymotion">xi23l</videoflash>

or (with width and height):

<videoflash type="dailymotion">xi23l|640|480</videoflash>


Original url:

Wiki code:

<videoflash type="vimeo">9394817</videoflash>

or (with width and height):

<videoflash type="vimeo">9394817|640|480</videoflash>


Original url:

Wiki code:

<videoflash type="sevenload">Eh4mjir</videoflash>

or (with width and height):

<videoflash type="sevenload">Eh4mjir|640|480</videoflash>


Original url:

Wiki code:

<videoflash type="revver">138657</videoflash>

or (with width and height):

<videoflash type="revver">138657|640|480</videoflash>


Original url:

Wiki code:

<videoflash type="metacafe" vid="pump_it">2387062</videoflash>

or (with width and height):

<videoflash type="metacafe" vid="pump_it">2387062|640|480</videoflash>


Currently blip uses urls like:

You cannot use the above ID with the code$someID

which is used in this VideoFlash extension.

To get the correct ID to use click on 'embed' in Blip and extract the id used in the flash embed code

 <embed src="" type="application/x-shockwave-flash" width="640" height="510" allowscriptaccess="always" allowfullscreen="true"></embed>

Wiki code:

<videoflash type="blip">AdvpMQA</videoflash>

note: I don't know why uses different ID's in it's embed code as opposed to it's url. I suspect it may be changing over or something, which is why I haven't suggested editing the code of this extension to use the 'file' rather than the 'play' url for Blip.

Globo Vídeos (Brazil)Edit


Add the command line


the file videoflash.php

Copy the parameter midiaId

  <embed width="480" height="392" flashvars="midiaId=1056877&autoStart=false&width=480&height=392" type="application/x-shockwave-flash" quality="high" src=""></embed>

Wiki code:

<videoflash type="globovideo">1056877</videoflash>


by Frank Forte

Adding HTML5 videos (webm, mp4, ovg formats) simply replace the video URL below in your wiki when using videoflash extension.

Wiki code:

<videoflash type="html5" style="width:200px;height:150px;"></videoflash>


  • 1.1 - 2007-03-24 - Added Revver support; fixed xss vulnerability (tnx Jimbojw)
  • 1.0 - 2007-01-23 - First release

MediaWiki VersionEdit

  • Successfully tested on MediaWiki 1.6.9, MediaWiki 1.8.4, MediaWiki 1.9.3, MediaWiki 1.15.0 (for Vimeo) and MediaWiki 1.16.0 (for megavideo)

Full ScreenEdit

*                                                                              *
* Simple "View in fullscreen" addon by                           *
*                                                                              *
* At the end, before the output is returned, add:                              *
*                                                                              *

if (strstr($type, "googlevideo")){
        $output .= '<p><a href="javascript:void('
        .'">View the video in fullscreen</a></p>';

        return $output;

Other implementationsEdit

  • Video Widgets category on MediaWiki widgets site (has all the widgets this extension supports and more)

Wikis using this extensionEdit

See here. Please add your wiki, too.

See alsoEdit