\n";
echo " 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',\n";
echo " 'width', '$width',\n";
echo " 'height', '$height',\n";
echo " 'src', 'x',\n";
echo " 'quality', 'high',\n";
echo " 'pluginspage', 'http://www.macromedia.com/go/getflashplayer',\n";
echo " 'align', 'middle',\n";
echo " 'play', 'true',\n";
echo " 'loop', 'true',\n";
echo " 'scale', 'showall',\n";
echo " 'FlashVars', '$flashvars',\n";
echo " 'allowFullScreen', 'true',\n";
echo " 'movie', '$swf'\n";
echo " }\n";
echo "\n";
echo "\n";
}
function getflvsize($flv){
$getID3 = new getID3;
$fileinfo = $getID3->analyze($flv);
if(!($fileinfo['meta']['onMetaData']['width'] && $fileinfo['meta']['onMetaData']['height']))
return false;
$width = $fileinfo['meta']['onMetaData']['width'];
$height = $fileinfo['meta']['onMetaData']['height'];
return array($width, $height);
}
function flvheader(){
static $once=true;
if($once){
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
echo "";
else
echo "";
}
$once = false;
}
function flvstring($movie, $width=-1, $height=-1, $fgcolor='', $bgcolor='', $autoplay=false, $autoload=true, $autorewind=true, $volume=70, $loop=false, $mute=false, $muteonly=false, $clickurl='', $clicktarget=''){
if(!file_exists($movie))
return "Movie not found.";
if($width == -1 || $height == -1)
list($width, $height) = getflvsize($movie);
$height += 40;
$retval = '';
$options = array();
if($fgcolor && $fgcolor !== '' && $fgcolor !== 'default')
$options[] = "fgcolor=$fgcolor";
if($bgcolor && $bgcolor !== '' && $bgcolor !== 'default')
$options[] = "bgcolor=$bgcolor";
if($autoplay && $autoplay !== '' && $autoplay !== 'default')
$options[] = 'autoplay=on';
if(!$autoload)
$options[] = 'autoload=off';
if(!$autorewind)
$options[] = 'autorewind=off';
if($volume && $volume !== '' && $volume !== 'default')
$options[] = "volume=$volume";
if($loop && $loop !== '' && $loop !== 'default')
$options[] = 'loop=on';
if($mute && $mute !== '' && $mute !== 'default')
$options[] = 'mute=on';
if($muteonly && $muteonly !== '' && $mute !== 'default')
$options[] = 'muteonly=on';
if($clicktarget)
$options[] = "clicktarget=$clicktarget";
if($clickurl)
$options[] = "clickurl=$clickurl";
$options = implode('&', $options);
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
$retval = "\n";
$retval .= "\n";
$retval .= "\n";
return $retval;
}
function flv($movie, $width=-1, $height=-1, $fgcolor='', $bgcolor='', $autoplay=false, $autoload=true, $autorewind=true, $volume=70, $loop=false, $mute=false, $muteonly=false, $clickurl='', $clicktarget=''){
echo flvstring($movie, $width, $height, $fgcolor, $bgcolor, $autoplay, $autoload, $autorewind, $volume, $loop, $mute, $muteonly, $clickurl, $clicktarget);
}
?>