Extension:VideoFlash
|
VideoFlash Release status: unknown |
|
|---|---|
| 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 |
| Last version | 1.2.3 (2010-08-18) |
| MediaWiki | 1.6.8 or above |
| License | No license specified |
| Download | see below |
|
Check usage (experimental) |
|
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.
Contents |
[edit] Source
Copy the following code into extensions/videoflash.php:
<?php /** * last change: 2011-03-16 * Available under the GFDL (http://www.gnu.org/copyleft/fdl.html) as source code was taken from http://www.mediawiki.org/wiki/Extension:VideoFlash * Modification by SignpostMarv Martin * html5 added by Frank Forte */ /******************************************************************************* * * * VideoFlash Extension by Alberto Sarullo, based on YouTube (Iubito) extension * * http://www.mediawiki.org/wiki/Extension:VideoFlash * * * * * * Tag : * * <videoflash>v</videoflash> * * * * Ex : * * from url http://www.youtube.com/watch?v=4lhyH5TsuPg * * <videoflash>4lhyH5TsuPg</videoflash> * * * * Ex: * * from url http://video.google.it/videoplay?docid=1811233136844420765 * * <videoflash type="googlevideo">1811233136844420765</videoflash> * * * * Ex: * * from url http://en.sevenload.com/videos/7DQGFhH/Sexy-Tussis * * <videoflash type="sevenload">7DQGFhH</videoflash> * * * * Ex: * * from url http://one.revver.com/watch/138657 * * <videoflash type="revver">138657</videoflash> * * * * * * Ex: (use class or style attribute to set width/height) ************ * from url http://website.com/video.ogv (ovg, mp4, webm allowed) * * <videoflash type="html5" class="anything">http://website.com/video.ogv</videoflash> * * * *******************************************************************************************/ $wgExtensionFunctions[] = 'wfVideoFlash'; $wgExtensionCredits['parserhook'][] = array( 'name' => 'VideoFlash', 'description' => 'VideoFlash (YouTube, GoogleVideo, Dailymotion, sevenload...)', 'author' => 'Alberto Sarullo, SignpostMarv Martin, Frank Forte', 'url' => 'http://www.mediawiki.org/wiki/Extension:VideoFlash' ); 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' ] = 'http://www.youtube.com/v/%1$s?fs=%5$u'; $url['googlevideo'] = 'http://video.google.com/googleplayer.swf?docId=%1$d'; $url['dailymotion'] = 'http://www.dailymotion.com/swf/%1$s'; $url['sevenload' ] = 'http://en.sevenload.com/pl/%1$s/%2$ux%3$u/swf'; $url['revver' ] = 'http://flash.revver.com/player/1.0/player.swf?mediaId=%1$u'; $url['blip' ] = 'http://blip.tv/play/%1$s'; $url['youku' ] = 'http://player.youku.com/player.php/sid/%1$s/.swf'; $url['vimeo' ] = 'http://www.vimeo.com/moogaloop.swf?clip_id=%1$d&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=0&show_portrait=0'; $url['metacafe' ] = 'http://www.metacafe.com/fplayer/%1$d/' . (isset($args['vid']) ? $args['vid'] : '') . '.swf'; $url['viddler' ] = 'http://www.viddler.com/player/%1$s'; $url['megavideo' ] = 'http://www.megavideo.com/v/%1$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; } else { $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); } } ?>
[edit] Installation
- 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:
require_once("extensions/videoflash.php");
[edit] Usage
[edit] Youtube
Original url: http://www.youtube.com/watch?v=3EszBH3cQqI
Wiki code:
<videoflash>3EszBH3cQqI</videoflash>
or (with width and height):
<videoflash>3EszBH3cQqI|200|100</videoflash>
[edit] GoogleVideo
Original url: http://video.google.it/videoplay?docid=1811233136844420765
Wiki code:
<videoflash type="googlevideo">1811233136844420765</videoflash>
or (with width and height):
<videoflash type="googlevideo">1811233136844420765|200|150</videoflash>
[edit] DailyMotion
Original url: http://www.dailymotion.com/video/xi23l_geris-game
Wiki code:
<videoflash type="dailymotion">xi23l</videoflash>
or (with width and height):
<videoflash type="dailymotion">xi23l|640|480</videoflash>
[edit] Vimeo
Original url: http://vimeo.com/9394817
Wiki code:
<videoflash type="vimeo">9394817</videoflash>
or (with width and height):
<videoflash type="vimeo">9394817|640|480</videoflash>
[edit] Sevenload
Original url: http://en.sevenload.com/videos/Eh4mjir/Bewegungen-der-Natur
Wiki code:
<videoflash type="sevenload">Eh4mjir</videoflash>
or (with width and height):
<videoflash type="sevenload">Eh4mjir|640|480</videoflash>
[edit] Revver
Original url: http://one.revver.com/watch/138657
Wiki code:
<videoflash type="revver">138657</videoflash>
or (with width and height):
<videoflash type="revver">138657|640|480</videoflash>
[edit] MetaCafe
Original url: http://www.metacafe.com/watch/2387062/pump_it/
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>
[edit] Blip
Currently blip uses urls like: http://blip.tv/file/1490573
You cannot use the above ID with the code
http://blip.tv/play/$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="http://blip.tv/play/AdvpMQA" 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 Blip.tv 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.
[edit] Globo Vídeos (Brazil)
by alexandre260678@hotmail.com
Add the command line
$url['globovideo']='http://video.globo.com/Portal/videos/cda/player/player.swf?midiaId=%1$u';
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="http://video.globo.com/Portal/videos/cda/player/player.swf"></embed>
Wiki code:
<videoflash type="globovideo">1056877</videoflash>
[edit] HTML5
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;">http://yourwebsite.com/yourvideo.webm</videoflash>
[edit] History
- 1.1 - 2007-03-24 - Added Revver support; fixed xss vulnerability (tnx Jimbojw)
- 1.0 - 2007-01-23 - First release
[edit] MediaWiki Version
- 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)
[edit] Full Screen
/******************************************************************************* * * * Simple "View in fullscreen" addon by xiandos.info. * * * * At the end, before the output is returned, add: * * * ********************************************************************************/ if (strstr($type, "googlevideo")){ $output .= '<p><a href="javascript:void(window.open(' ."'http://video.google.com/googleplayer.swf?docid=" .$id ."','GooglePlayer','location=no,menubar=no,scrollbars=auto,status=no," ."toolbar=no,fullscreen=yes,dependent=no,left=1,top=1'))" .'">View the video in fullscreen</a></p>'; } return $output;
[edit] Other implementations
- Video Widgets category on MediaWiki widgets site (has all the widgets this extension supports and more)
[edit] Wikis using videoflash
If you use this extension, please add your website here.
- A+医学百科 - A Chinese Medical Encyclopedia. (a sample page: 人体穴位图, video from youku)
- Project Brahma - Documenting the biodiversity of India
- You solve it - An italian site of physics problems and stuff
- PortlandWiki - The community-powered knowledge commons for Portland, Oregon.
- Gamification.org - Wiki for Gamification and Game Mechanics Discussion.
- EierWiki - Wiki of Ferrero Suprise Egg Toys
- wikiMama - Wiki of photoed and videoed cooking recipes
- Wolf Wiki - A Hacker Wiki.
- opencoaching - a soccer coaching wiki
- Wikiants - an Open Content Encyclopedia
- WikiPenis - A wiki relating to everything male sexual health. (It's clean...no adult stuff.)
- WikiAudio - A user created reference for everything audio or sound related
- a french workshop wiki
- Rink Hockey Portal
- Series episodes guide
- Klusopedia.nl A dutch wiki on home improvement and DIY tips & tricks.
- Catallaxia.net
- syn2cat Hackerspace Luxembourg
- Smashball Player Guide
- Geek My Ride
- WikiMediation, le site des professionnels de la résolution des conflits
- Wikipiada.com
- Second Life Video Tutorials
- WikiRides.com Automotive Enthusiast Wiki
- expliki.org Knowledge about the borderlands of science. Example (german)
- DharmaFlix.com Buddhist film video wiki
- GreatCuba.com Cuba Travel Wiki
- aessenet.org wiki
- Quadratus.ws
- Wiki in the Wii (of Nintendo)
- [1] Halo Video Game Universe wiki
- xiandos.info (example)
- Dikt (Norwegian)
- German Green Party (Neustadt - Bremen) (and use "revverflash" to display videos from Revver - Example)
- Wikiela - share your recipes and make money
- Indian student wiki
- MusicalWiki (Dutch)
- The Internet Movie Firearms Database
- Final Fantasy: One Winged Angel Wiki
- gaystar ut2004 clan
- WikiSwing
- Ask in Wiki
- Malay Computer Encyclopedia
- Mod Mania
- Physical Programming
- Bal Vividha wiki - A Collaborative Initiative
- JerezSiempre.com Jerez de la Frontera Wiki
- Wikidebrouillard.org Le wiki d'expériences scientifiques de la vie quotidienne en vidéos !
- Nieuwe Geletterdheid (Dutch educational wiki)
- Documentazione Paghe Pro (Italy)
- ClassicKidsTV.co.uk
- FRC:Wiki
- Scoutopedia
- wiki.savage-forum.com
- 24chan Wiki
- FormaVia Réseau rhônalpin des acteurs des TIC et de la formation continue
- Primepedia Alles über Primeval - Die Rückkehr der Urzeitmonster
- Cranckers aNd Soup
- Nastywiki
- BYU's Ph.D. Prep Track You can see embedded videos on the main page or on the Accounting Humor page
- Werebuild.eu
- Babe Facts
- EEG Laboratory - Curtin University/Perth (wiki only accessible from local network)
- Pornopedia Erotic wiki
- WikiJaveriana
- OilWiki.org
- Agent Storm Wiki
- Wiki Caradoc mercenary Compagny on Mythodea
- Vafud using extension with megavideo on mediawiki 1.16 on Postgresql. See an example here: hot ice.
- Diaspora Social Network Wiki
- WikID - The Industrial Design Engineering Wiki
- RedditPublic.com - The McPublic Reddit Minecraft wiki
- Wiki-Rennes, a city wiki in Rennes, France
- My-lab.it, an italian technology lab
- Pl@ntUse
- skinheadten
- WikiTrazoide Drawing technical, geometry and cad (in spanish) / Dibujo técnico, geometría y cad (en español)
- Wiki de ocio y turismo (en español)
- WikiAirsoft Airsoft in Russia (in russian)
- “LibertoPedia — Encyclopedia of Freedom” | ЛибертоПедия, вики.викиликс.орг.рф
- The Dominion Atlantic Railway Digital Preservation Initiative
[edit] See also
- Extension:FramedVideo - fork of this extension (unmaintained)
