From: <var...@us...> - 2009-09-24 09:01:24
|
Revision: 7153 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7153&view=rev Author: vargenau Date: 2009-09-24 09:01:07 +0000 (Thu, 24 Sep 2009) Log Message: ----------- New plugin to add video in wiki pages Added Paths: ----------- trunk/lib/plugin/Video.php trunk/pgsrc/Help%2FVideoPlugin trunk/themes/default/flowplayer-3.1.3.swf trunk/themes/default/flowplayer.controls-3.1.3.swf Added: trunk/lib/plugin/Video.php =================================================================== --- trunk/lib/plugin/Video.php (rev 0) +++ trunk/lib/plugin/Video.php 2009-09-24 09:01:07 UTC (rev 7153) @@ -0,0 +1,118 @@ +<?php // -*-php-*- +rcs_id('$Id$'); +/* + * Copyright 2009 Roger Guignard and Marc-Etienne Vargenau, Alcatel-Lucent + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it 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. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Standard Alcatel-Lucent disclaimer for contributing to open source + * + * "The VideoPlugin ("Contribution") has not been tested and/or + * validated for release as or in products, combinations with products or + * other commercial use. Any use of the Contribution is entirely made at + * the user's own responsibility and the user can not rely on any features, + * functionalities or performances Alcatel-Lucent has attributed to the + * Contribution. + * + * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY + * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE, + * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE + * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER + * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND + * ALONE BASIS." + */ + +class WikiPlugin_Video +extends WikiPlugin +{ + function getName() { + return _("Video"); + } + + function getDescription() { + return _("Display video in Flash"); + } + + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); + } + + function getDefaultArguments() { + return array('width' => 460, + 'height' => 320, + 'url' => '', + 'file' => '', + 'autoplay' => 'false' + ); + } + + function run($dbi, $argstr, &$request, $basepage) { + + global $WikiTheme; + $args = $this->getArgs($argstr, $request); + extract($args); + + $html = HTML(); + + $object = HTML::object(array('data' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), + 'type' => "application/x-shockwave-flash", + 'width' => $width, + 'height' => $height)); + + $param = HTML::param(array('name' => "allowfullscreen", + 'value' => "true")); + $object->pushContent($param); + + $param = HTML::param(array('name' => "allowscriptaccess", + 'value' => "false")); + $object->pushContent($param); + + if (! $url && ! $file) { + return $this->error(_("Both 'url' or 'file' parameters missing.")); + } + elseif ($url && $file) { + return $this->error(_("Choose only one of 'url' or 'page' parameters.")); + } + elseif ($file) { + $url = SERVER_URL . getUploadDataPath() . '/' . $file; + } + $value = "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}"; + $param = HTML::param(array('name' => "flashvars", + 'value' => $value)); + $object->pushContent($param); + + $html->pushContent($object); + + return $html; + } +}; + +// Local Variables: +// mode: php +// tab-width: 4 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: +?> Property changes on: trunk/lib/plugin/Video.php ___________________________________________________________________ Added: svn:keywords + Id Revision Added: trunk/pgsrc/Help%2FVideoPlugin =================================================================== --- trunk/pgsrc/Help%2FVideoPlugin (rev 0) +++ trunk/pgsrc/Help%2FVideoPlugin 2009-09-24 09:01:07 UTC (rev 7153) @@ -0,0 +1,65 @@ +Date: Thu, 24 Sep 2009 10:54:37 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) +X-Rcs-Id: $Id$ +Content-Type: application/x-phpwiki; + pagename=Help%2FVideoPlugin; + flags=PAGE_LOCKED%2CEXTERNAL_PAGE; + markup=2; + charset=UTF-8 +Content-Transfer-Encoding: binary + +The **~Video** [[Help:WikiPlugin|plugin]] allows to include video in a wiki page. +Video file must be encoded in FLV format. + +== Arguments + +Use only one of ##url## or ##file## arguments at a time. + +{| class="bordered" +|- +! Argument +! Description +! Default value +|- +| **url** +| The url of a video file. +| none +|- +| **file** +| The name of a video file that has been uploaded. +| none +|- +| **width** +| The width of the video (in pixels). +| 460 +|- +| **height** +| The height of the video (in pixels). +| 320 +|- +| **autoplay** +| Auto play the video when page is displayed. +| false +|} + +== Example + +A video : +{{{ +<<Video url=http://a.video.server/a_video.flv>> +}}} + +Another video : +{{{ +<<Video file=another_video.flv>> +}}} + +== Authors + +* Roger Guignard, Alcatel-Lucent +* Marc-Etienne Vargenau, Alcatel-Lucent + +<noinclude> +---- +[[PhpWikiDocumentation]] [[CategoryWikiPlugin]] +</noinclude> Property changes on: trunk/pgsrc/Help%2FVideoPlugin ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/themes/default/flowplayer-3.1.3.swf =================================================================== (Binary files differ) Property changes on: trunk/themes/default/flowplayer-3.1.3.swf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/themes/default/flowplayer.controls-3.1.3.swf =================================================================== (Binary files differ) Property changes on: trunk/themes/default/flowplayer.controls-3.1.3.swf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |