Extension:GoogleVideo

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
GoogleVideo

Release status: unknown

Implementation Tag
Description This extension allows to display Google Videos in your wiki.
Author(s) Sylvain Machefert (Iubito Talk)
Download see below
Example Balkan Party 2006

GoogleVideo extension displays videos from Google Video. Upload your videos to Google and then share them in your wiki!

View a demo at Balkan Party 2006 on my wiki.

[edit] Installation

Add this line at the end of LocalSettings.php :

include('extensions/googleVideo.php');

Copy the following code into extensions/googleVideo.php :

<?php
# Google Videos
# 
# Tag :
#   <googlevideo>docid</googlevideo>
# Ex :
#   from url http://video.google.com/videoplay?docid=6444586097901795775
#   <googlevideo>6444586097901795775</googlevideo>
# 
# Enjoy !
 
$wgExtensionFunctions[] = 'wfGoogleVideo';
$wgExtensionCredits['parserhook'][] = array(
        'name' => 'Google Video',
        'description' => 'Display Google Video',
        'author' => 'Sylvain Machefert',
        'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleVideo'
);
 
function wfGoogleVideo() {
        global $wgParser;
        $wgParser->setHook('googlevideo', 'renderGoogleVideo');
}
 
# The callback function for converting the input text to HTML output
function renderGoogleVideo($input) {
        //$input = "6444586097901795775"
        $width = 425;
        $height = 350;
 
        $output = '<embed style="width:'.$width.'px; height:'.$height.'px;" '
                .'id="VideoPlayback" type="application/x-shockwave-flash" '
                .'src="http://video.google.com/googleplayer.swf?docId='
                .$input.'"> </embed>';
        return $output;
}

That's all :-)

[edit] Usage

Usage is as follows: <googlevideo>docid</googlevideo>

Personal tools