<?php

// Wiki plugin to display a Windows Media movie )
// gg - 30.09.2005 -
// derived from flash-plugin - 

function wikiplugin_wmv_help() {
        return tra("Displays a Microsoft Movie on the wiki page").":<br />~np~{WMV(width=>xx,height=>xx,controller=>true|false,autostart=>1|0)}".tra("URL to Movie")."{WMV}~/np~:<br />".tra("width and height  are optional. Default is 320 x 240. controller is set to true by default. autostart is set to 0 (false) by default.");
}

function wikiplugin_wmv($movie, $params) {
 extract ($params);
   $movie = preg_replace("'<[\/\!]*?[^<>]*?>'si","only URL here! ","$movie");
   if (!isset($width)) {
     $width = 320; }
   if (!isset($height)) {
     $height = 240; }
   if (!isset($autostart)) {
     $autostart = "0"; }
   if ($autostart !== "0") {
     $autostart = "1"; }
   if (!isset($controller)) {
     $controller = "true"; }
   if ($controller !== "true") {
     $controller = "false"; }
   if ($controller == "true") {
     $height = ($height + 16); }

// Start of WMV code
   $asetup = "<object id=\"MediaPlayer1\" ";
   $asetup .= "width=\"$width\" height=\"$height\" ";
   $asetup .= "classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\" ";
   $asetup .= "standby=\"Loading...\" ";
   $asetup .= "type=\"application/x-oleobject\"> ";
   $asetup .= "<param name=\"Filename\" value=\"$movie\"> ";
   $asetup .= "<param name=\"Autostart\" value=\"$autostart\"> ";
   $asetup .= "<param name=\"ShowControls\" value=\"$controller\"> ";
   $asetup .= "<embed type=\"application/x-mplayer2\" ";
   $asetup .= "name=\"MediaPlayer1\" ";
   $asetup .= "pluginspage = \"http://www.microsoft.com/Windows/MediaPlayer/\" ";
   $asetup .= "width=\"$width\" ";
   $asetup .= "height=\"$height\" ";
   $asetup .= "src=\"$movie\" ";
   $asetup .= "autostart=\"$autostart\" ";
   $asetup .= "showcontrols=\"$controller\"> ";
   $asetup .= "</embed> ";
   $asetup .= "</object> ";
// End of WMV code
return $asetup;
}

?>