<?php if (!defined('PmWiki')) exit (); /* copyright 2007 Jon Haupt. Build on code from swf.php copyright 2004 Patrick R. Michaud and from quicktime.php copyright 2006 Sebastian Siedentopf. This file is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This module enables embedding of Google Video, Vimeo, and YouTube movies into wiki pages. simply use: (:googlevideo whatever:) (:youtube whatever:) (:vimeo whatever:) where 'whatever' is the unique number given to your movie. 22Jan08: Edited by Byron Lunz to update Google and YouTube functions. Prior to this update this script worked with Firefox 2 but not IE6. Not tested on Vimeo nor with IE7. */ # Version date $RecipeInfo['SWFSites']['Version'] = '2008-01-22'; Markup('googlevideo', '<img', "/\\(:googlevideo (.*?)\\s*:\\)/e", "ShowGoogleVideo('$1')"); Markup('vimeo', '<img', "/\\(:vimeo (.*?)\\s*:\\)/e", "ShowVimeoVideo('$1')"); Markup('youtube', '<img', "/\\(:youtube (.*?)\\s*:\\)/e", "ShowYouTube('$1')"); function ShowGoogleVideo($url) { $out = "<embed style=\"width:400px; height:326px;\" id=\"VideoPlayback\" type=\"application/x-shockwave-flash\" "; $out .= "src=\"http://video.google.com/googleplayer.swf?docId=$url&hl=en\" flashvars=\"\"> </embed>"; return Keep($out); } function ShowVimeoVideo($id) { $out = "\n<object type='application/x-shockwave-flash' "; $out .= "width='480' height='360' "; $out .= "data='http://vimeo.com/moogaloop.swf?clip_id=$id"; $out .= "&server=vimeo.com&fullscreen=1&show_title=1"; $out .= "&show_byline=1&show_portrait=1&color=00ADEF'>"; $out .= "\n <param name='quality' value='best' />"; $out .= "\n <param name='allowfullscreen' value='true' />"; $out .= "\n <param name='scale' value='showAll' />"; $out .= "\n <param name='movie' value='http://vimeo.com/moogaloop.swf?clip_id=$id&server=vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=1&color=00ADEF' />"; $out .= "\n</object>"; return Keep($out); } function ShowYouTube($url) { $out = "\n<object width=\"425\" height=\"355\">"; $out .= "<param name=\"movie\" value=\"http://www.youtube.com/v/$url\"></param>"; $out .= "<param name=\"wmode\" value=\"transparent\"></param>"; $out .= "<embed src=\"http://www.youtube.com/v/$url\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"355\"></embed>"; $out .= "</object>"; return Keep($out); }