460, 'height' => 320, 'url' => '', 'file' => '', 'autoplay' => 'false', 'image' => '' ); } function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $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 'file' parameters.")); } elseif ($file) { $url = getUploadDataPath() . $file; } // TODO: Check HTML5 browser capabilities 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.")); } if (!$image) $image = $url; if ($autoplay != 'true' and $autoplay != 'false') return $this->error(fmt("Invalid argument %s", "autoplay")); if (!is_numeric($width)) return $this->error(fmt("Invalid argument %s", "width")); if (!is_numeric($height)) return $this->error(fmt("Invalid argument %s", "height")); if (preg_match("/'/", $url)) return $this->error(fmt("Invalid argument %s", "url")); $params = array("data" => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.4.swf'), "type" => "application/x-shockwave-flash", "width" => $width, "height" => $height, "allowfullscreen" => "true", "allowscriptaccess" => "false", "flashvars"=> "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}'"); return ImgObject(HTML::img(array('src' => $image)), $params); } }; // Local Variables: // mode: php // tab-width: 4 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>