<?php

// $Header: wikiplugin_mov.php,v 0.3 2004/06/10 13:10:00 kiilo Exp $
// Wiki plugin to display a QUICKTIME mov :o)
// see http://www.apple.com/quicktime/tools_tips/tutorials/activex.html for IE5.5, IE6 compatibilty
// kiilo - 20.06.2004 - zurich
// derived from flash-plugin - thx damian!

function wikiplugin_mov_help() {
        return tra("Displays a Quicktime Movie on the wiki page").":<br />~np~{MOV(width=>xx,height=>xx,controller=>true|false,autoplay=>true|false,loop=>false|true)}".tra("URL to Movie")."{MOV}~/np~:<br />".tra("with and height is optional if leaving blank 320 x 240 is used. controller is set to true by default.");
}

function wikiplugin_mov($movie, $params) {
 extract ($params);
   $movie = preg_replace("'<[\/\!]*?[^<>]*?>'si","only URL here! ","$movie");   
   if (!isset($width)) {
     $width = 320; }
   if (!isset($height)) {
     $height = 240; }
   if (!isset($loop)) {
     $loop = "false"; }
   if (!isset($autoplay)) {
     $autoplay = "true"; }
   if (!isset($controller)) {
     $controller = "true"; } 
   if ($controller !== "true") {
     $controller = "false"; } 
   if ($controller == "true") {
     $height = ($height + 16); }
   $asetup = "<OBJECT CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" CODEBASE=\"http://www.apple.com/qtactivex/qtplugin.cab\" ";
   $asetup .= "WIDTH=\"$width\" HEIGHT=\"$height\" SCALE=\"tofit\">";
   $asetup .= "<PARAM NAME=\"src\" VALUE=\"$movie\">";
   $asetup .= "<PARAM NAME=\"autoplay\" VALUE=\"$autoplay\">";
   $asetup .= "<PARAM NAME=\"loop\" VALUE=\"$loop\">";
   $asetup .= "<PARAM NAME=\"controller\" VALUE=\"$controller\">";
   $asetup .= "<embed src=\"$movie\" autoplay=\"$autoplay\" scale=\"tofit\" pluginspage=\"http://www.apple.com/quicktime/download/\" type=\"video/quicktime\" ";
   $asetup .= "width=\"$width\" height=\"$height\" loop=\"$loop\" ";
   $asetup .= "controller=\"$controller\">";
   $asetup .= "</embed></object>";
return $asetup;
}

?>
