From: <var...@us...> - 2009-10-11 14:18:24
|
Revision: 7202 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7202&view=rev Author: vargenau Date: 2009-10-11 14:18:08 +0000 (Sun, 11 Oct 2009) Log Message: ----------- Allow OGG in Video plugin with HTML 5 <video> tag Modified Paths: -------------- trunk/lib/HtmlElement.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/Video.php trunk/lib/stdlib.php Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/HtmlElement.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -437,6 +437,12 @@ $el = new HtmlElement('legend'); return $el->_init2(func_get_args()); } + + /****************************************/ + function video (/*...*/) { + $el = new HtmlElement('video'); + return $el->_init2(func_get_args()); + } } define('HTMLTAG_EMPTY', 1); @@ -460,7 +466,7 @@ . 'div fieldset frameset' // other with inline content - . 'caption dt label legend ' + . 'caption dt label legend video ' // other with either inline or block . 'dd del ins li td th colgroup'); Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/plugin/UpLoad.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -88,6 +88,7 @@ odp ods odt +ogg patch pdf png Modified: trunk/lib/plugin/Video.php =================================================================== --- trunk/lib/plugin/Video.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/plugin/Video.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -73,6 +73,20 @@ $args = $this->getArgs($argstr, $request); extract($args); + 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; + $url = getUploadDataPath() . '/' . $file; + } + + if (string_ends_with($url, ".ogg")) { + return HTML::video(array('autoplay' => 'true', 'controls' => 'true', 'src' => $url), + _("Your browser does not understand the HTML 5 video tag.")); + } + $html = HTML(); $object = HTML::object(array('data' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), @@ -88,15 +102,6 @@ '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)); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/stdlib.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -2463,7 +2463,8 @@ */ function is_video ($filename) { - return string_ends_with(strtolower($filename), ".flv"); + return string_ends_with(strtolower($filename), ".flv") + or string_ends_with(strtolower($filename), ".ogg"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |