Extension:YouTube (Iubito)

This extension displays videos from YouTube. Upload your videos to YouTube and then share them in your wiki !

View a demo in the sandbox of my wiki.

Add this line at the end of LocalSettings.php : include('extensions/youTube.php');

Copy the following code into extensions/youTube.php :  'YouTube',	'description' => 'Display YouTube video',	'author' => 'Sylvain Machefert',	'url' => 'http://meta.wikimedia.org/wiki/YouTube' );

function wfYouTube { global $wgParser; $wgParser->setHook('youtube', 'renderYouTube'); }

function renderYouTube($input) { //$input = "WZpeeRSk-0A"
 * 1) The callback function for converting the input text to HTML output

$width = 425; $height = 350;

//Validate the video ID	if (preg_match('%[^A-Za-z0-9_\\-]%',$params['video'])) { return 'YouTube : bad video ID !'; }

$output='' .'' .'  ' .'  ';

return $output; } ?>

That's all :-)