Jump to content

Extension:VideoFlash: Difference between revisions

From Episode D6: Star Wars D6 Wiki
Created page with "{{Extension |name = VideoFlash |author = Alberto Sarullo, SignpostMarv Martin |type = tag |download = see below |ver..."
 
Replaced content with "http://www.mediawiki.org/wiki/Extension:VideoFlash"
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Extension
http://www.mediawiki.org/wiki/Extension:VideoFlash
|name      = VideoFlash
|author    = [[User:Args|Alberto Sarullo]], [[User:SignpostMarv|SignpostMarv Martin]]
|type      = tag
|download  = [[#Source|see below]]
|version  = 1.2.3
|update    = 2010-08-18
|mediawiki = 1.6.8 or above
|description =  VideoFlash is an extension that displays videos from Youtube, GoogleVideo, Dailymotion, Sevenload, Revver and similar services
}}
 
'''VideoFlash''' is an extension that displays videos from Youtube, GoogleVideo, Dailymotion, Sevenload, Revver and similar services based on FLV video format.
 
This extension is based on [[Extension:YouTube (Iubito)]] extension.
 
== Source ==
 
Copy the following code into <tt>extensions/videoflash.php</tt>:
 
<source lang="php">
<?php
/**
* last change: 2010-09-30
*      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
*/
/*******************************************************************************
*                                                                              *
* 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>                              *
*                                                                              *
********************************************************************************/
 
$wgExtensionFunctions[] = 'wfVideoFlash';
$wgExtensionCredits['parserhook'][] = array(
'name' => 'VideoFlash',
'description' => 'VideoFlash (YouTube, GoogleVideo, Dailymotion, sevenload...)',
'author' => 'Alberto Sarullo, SignpostMarv Martin',
'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&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;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';
 
// 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;
 
$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);
}
?></source>
 
== 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 '''[[Manual:$IP|$IP]]/extensions''' directory.
* Add the following lines at the end of '''[[Manual:LocalSettings.php|LocalSettings.php]]''':
<source lang="php">
require_once("extensions/videoflash.php");
</source>
 
== Usage ==
=== Youtube ===
 
Original url: http://www.youtube.com/watch?v=3EszBH3cQqI
 
Wiki code:
 
<pre>
<videoflash>3EszBH3cQqI</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash>3EszBH3cQqI|200|100</videoflash>
</pre>
 
=== GoogleVideo ===
 
Original url: http://video.google.it/videoplay?docid=1811233136844420765
 
Wiki code:
 
<pre>
<videoflash type="googlevideo">1811233136844420765</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="googlevideo">1811233136844420765|200|150</videoflash>
</pre>
 
=== DailyMotion ===
 
Original url: http://www.dailymotion.com/video/xi23l_geris-game
 
Wiki code:
<pre>
<videoflash type="dailymotion">xi23l</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="dailymotion">xi23l|640|480</videoflash>
</pre>
 
=== Vimeo ===
 
Original url: http://vimeo.com/9394817
 
Wiki code:
<pre>
<videoflash type="vimeo">9394817</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="vimeo">9394817|640|480</videoflash>
</pre>
 
=== Sevenload ===
 
Original url: http://en.sevenload.com/videos/Eh4mjir/Bewegungen-der-Natur
 
Wiki code:
<pre>
<videoflash type="sevenload">Eh4mjir</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="sevenload">Eh4mjir|640|480</videoflash>
</pre>
 
=== Revver ===
 
Original url: http://one.revver.com/watch/138657
 
Wiki code:
<pre>
<videoflash type="revver">138657</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="revver">138657|640|480</videoflash>
</pre>
 
=== MetaCafe ===
 
Original url: http://www.metacafe.com/watch/2387062/pump_it/
 
Wiki code:
<pre>
<videoflash type="metacafe" vid="pump_it">2387062</videoflash>
</pre>
 
or (with width and height):
 
<pre>
<videoflash type="metacafe" vid="pump_it">2387062|640|480</videoflash>
</pre>
 
=== Blip ===
 
Currently blip uses urls like: http://blip.tv/file/1490573
You cannot use the above ID with the code <pre>http://blip.tv/play/$someID</pre> 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:
<pre>
<videoflash type="blip">AdvpMQA</videoflash>
</pre>
 
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.
 
=== Globo Vídeos (Brazil) ===
by alexandre260678@hotmail.com
 
Add the command line
 
<source lang="php">
$url['globovideo']='http://video.globo.com/Portal/videos/cda/player/player.swf?midiaId=%1$u';
</source>
 
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:
<pre>
<videoflash type="globovideo">1056877</videoflash>
</pre>
=== Questions and Concerns ===
 
The above listed video sources are not functional.  I am running the latest version of absolutely everything, including Windows 7 (not that it matters), in addition to the latest XAMPP, the latest MySQL, the latest MediaWiki, the latest Firefox and latest IE browsers, the latest Java, Flash, etc. I am fully up-to-date.
 
The videos on Dailymotion, Sevenload, Revver and Google do not function.  The flash player for Sevenload doesnt even render in the browser (leaves an ugly gap), while the other four renders but does not play.
 
Currently there is no support for videos on:
* [http://www.TeacherTube.com/ TeacherTube]
 
== History ==
*1.1 - 2007-03-24 - Added Revver support; fixed xss vulnerability (tnx [[User:Jimbojw|Jimbojw]])
*1.0 - 2007-01-23 - First release
 
== 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)'''
 
== Full Screen ==
 
<source lang="php">
/*******************************************************************************
*                                                                              *
* 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;
</source>
 
== Other implementations ==
* [http://www.mediawikiwidgets.org/Main_Page#Video_widgets Video Widgets] category on MediaWiki widgets site (has all the widgets this extension supports and more)
 
== Wikis using videoflash==
 
''If you use this extension, please add your website here.''
* [http://portlandwiki.org/PortlandWiki PortlandWiki] - The community-powered knowledge commons for Portland, Oregon.
* [http://www.gamification.org Gamification.org] - Wiki for Gamification and Game Mechanics Discussion.
* [http://www.eierwiki.de EierWiki] - Wiki of Ferrero Suprise Egg Toys
* [http://www.wikimama.com wikiMama] - Wiki of photoed and videoed cooking recipes
* [http://iamthewolf.info Wolf Wiki] - A Hacker Wiki.
* [http://opencoaching.net opencoaching] - a soccer coaching wiki
* [http://de.wikiants.org/Wikiants:Open_Movie Wikiants] - an Open Content Encyclopedia
* [http://www.enhancementresearch.com/wiki/ WikiPenis] - A wiki relating to everything male sexual health. (It's clean...no adult stuff.)
* [http://www.wikiaudio.org WikiAudio] - A user created reference for everything audio or sound related
* [http://cours.en.ligne.ensa-bourges.fr/wiki/ a french workshop wiki]
* [http://hoqueipatins.cat Rink Hockey Portal]
* [http://seriestv.webatu.com/ Series episodes guide]
* [http://www.klusopedia.nl/klussen/Video_player Klusopedia.nl] A dutch wiki on home improvement and DIY tips & tricks.
* [http://catallaxia.net/ Catallaxia.net]
* [http://hackerspace.lu/ syn<sub>2</sub>cat Hackerspace Luxembourg]
* [http://guide.smashball.tv/ Smashball Player Guide]
* [http://www.geekmyride.org/ Geek My Ride]
* [http://www.wikimediation.org WikiMediation, le site des professionnels de la résolution des conflits]
* [http://wikipiada.com/wiki/index.php?title=Rap_do_hidrante_-_Marcelo_Adnet_-_15_minutos Wikipiada.com]
* [http://wiki.secondlife.com/wiki/Video_Tutorials Second Life Video Tutorials]
* [http://www.wikirides.com WikiRides.com] Automotive Enthusiast Wiki
* [http://www.expliki.org expliki.org] Knowledge about the borderlands of science. [http://expliki.org/wiki/Hauptseite/Neuigkeiten/20071023 Example] (german)
* [http://www.Dharmaflix.com DharmaFlix.com] Buddhist film video wiki
* [http://www.greatcuba.com GreatCuba.com] Cuba Travel Wiki
* [http://www.aessenet.org/wiki/ aessenet.org wiki]
* [http://quadratus.ws Quadratus.ws]
* [http://wiikipedia.fr Wiki in the Wii (of Nintendo)]
* [http://xiandos.info/ xiandos.info] ([http://xiandos.info/The_PentaCon example])
* [http://dikt.org/ Dikt] (Norwegian)
* [http://www.gruene-neustadt.de German Green Party (Neustadt - Bremen)] (and use "[[Extension talk:VideoFlash|revverflash]]" to display videos from [http://one.revver.com/revver Revver] - [http://www.gruene-neustadt.de/index.php/Innovative_Kulturszene Example])
* [http://www.wikiela.com Wikiela - share your recipes and make money]
* [http://streamofdream.com/wiki/Main_Page Indian student wiki]
* [http://www.musicalwiki.net/ MusicalWiki] (Dutch)
* [http://www.imfdb.org The Internet Movie Firearms Database]
* [http://www.ffowa.org Final Fantasy: One Winged Angel Wiki]
* [http://www.gaystar.fr.st/ gaystar ut2004 clan]
* [http://www.wikiswing.com/ WikiSwing]
* [http://ask.inwiki.org/ Ask in Wiki]
* [http://e-komputer.info/wiki/Halaman_utama Malay Computer Encyclopedia]
* [http://www.openobject.org/modmania/Main_Page Mod Mania]
* [http://www.openobject.org/physicalprogramming/Main_Page Physical Programming]
* [http://www.balvividha.in Bal Vividha wiki - A Collaborative Initiative]
* [http://www.jerezsiempre.com JerezSiempre.com] Jerez de la Frontera Wiki
* [http://www.wikidebrouillard.org Wikidebrouillard.org] Le wiki d'expériences scientifiques de la vie quotidienne en vidéos !
* [http://www.webfrank.nl/nieuwegeletterdheid/index.php/Hoofdpagina Nieuwe Geletterdheid (Dutch educational wiki)]
* [http://www.iubar.it/wiki Documentazione Paghe Pro (Italy)]
* [http://www.classickidstv.co.uk ClassicKidsTV.co.uk]
* [http://frcwiki.com FRC:Wiki]
* [http://fr.scoutwiki.org/Accueil Scoutopedia]
* [http://wiki.savage-forum.com wiki.savage-forum.com]
* [http://www.24chan.org/wiki 24chan Wiki]
* [http://www.formavia.fr/ FormaVia] Réseau rhônalpin des acteurs des TIC et de la formation continue
* [http://www.Primepedia.de.tf/ Primepedia] Alles über Primeval - Die Rückkehr der Urzeitmonster
* [http://cns.ath.cx/ Cranckers aNd Soup]
* [http://tool.shagnasty.net/wiki Nastywiki]
* [http://www.byuaccounting.net/mediawiki/ BYU's Ph.D. Prep Track] You can see embedded videos on the main page or on the [http://www.byuaccounting.net/mediawiki/index.php?title=Accounting_Humor Accounting Humor page]
* [http://werebuild.eu Werebuild.eu]
* [http://www.babefacts.com Babe Facts]
* EEG Laboratory - Curtin University/Perth (wiki only accessible from local network)
* [http://de.pornopedia.eu/ Pornopedia] Erotic wiki
* [http://recursostic.javeriana.edu.co/wiki/index.php/Portada WikiJaveriana]
* [http://www.oilwiki.org OilWiki.org]
* [http://www.agentstorm.com/wiki Agent Storm Wiki]
* [http://caradoc.gnbzh.fr Wiki Caradoc] mercenary Compagny on Mythodea
* [http://www.vafud.com Vafud] using extension with megavideo on mediawiki 1.16 on Postgresql. See an example here: [http://www.vafud.com/index.php?title=Ghiaccio_istantaneo hot ice].
 
== See also ==
* [[Extension:FramedVideo]] - improved fork of this extension
 
[[Category:Video player extensions]]
[[Category:YouTube extensions]]

Latest revision as of 04:39, 3 December 2010