| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/components/com_youtubegallery/includes/ |
Upload File : |
<?php
/**
* YoutubeGallery
* @version 3.8.3
* @author DesignCompass corp< <support@joomlaboat.com>
* @link http://www.joomlaboat.com
* @GNU General Public License
**/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
if(!defined('DS'))
define('DS',DIRECTORY_SEPARATOR);
require_once(JPATH_SITE.DS.'components'.DS.'com_youtubegallery'.DS.'includes'.DS.'misc.php');
//not finished
class VideoSource_FLV
{
public static function extractFLVID($theLink)
{
return substr(md5($theLink),2,30);
}
public static function getVideoData($videoid,$theLink_,$customimage,$customtitle,$customdescription)
{
//API
//file.flv
$a=explode('/',str_replace('\\','/',$theLink_)); // to support windows
if(count($a)>0)
$FileName=$a[count($a)-1];
else
$FileName="FLV File";
$theLink=JPATH_SITE.DS.$theLink_;
$theTitle='';
$Description='';
$theImage='';
if(file_exists($theLink))
{
if($customimage=='')
$theImage='flvthumbnail';
else
$theImage=$customimage;
if($customtitle=='')
$theTitle=$FileName;
else
$theTitle=$customtitle;
if($customdescription=='')
$Description=$FileName;
else
$Description=$customdescription;
$videodata=array(
'videosource'=>'.flv',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>$theTitle,
'description'=>$Description,
'publisheddate'=>date('Y-m-d H:i:s',filectime($theLink)),
'duration'=>VideoSource_FLV::getFLVDuration($theLink),
'rating_average'=>0,
'rating_max'=>0,
'rating_min'=>0,
'rating_numRaters'=>0,
'statistics_favoriteCount'=>0,
'statistics_viewCount'=>0,
'keywords'=>''
);
return $videodata;
}
else
{
return array(
'videosource'=>'.flv',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>'Video not found or no connection.',
'description'=>$Description
);
}
}
static function getFLVDuration($theLink)
{
$flv = fopen($theLink, "rb");
fseek($flv, -4, SEEK_END);
$arr = unpack('N', fread($flv, 4));
$last_tag_offset = $arr[1];
fseek($flv, -($last_tag_offset + 4), SEEK_END);
fseek($flv, 4, SEEK_CUR);
$t0 = fread($flv, 3);
$t1 = fread($flv, 1);
$arr = unpack('N', $t1 . $t0);
$milliseconds_duration = $arr[1];
return (int)($milliseconds_duration/1000);
}
static function getThumbnailCode($link, $cssstyle,$aLink,$linkTarget)
{
$size=VideoSource_FLV::getThambnailSize($cssstyle);
$width=$size[0];
$height=$size[1];
$videolink="flvthumbnail.php?videofile=".urlencode($link);
//$videolink="flvthumbnail.php?videofile=".urlencode('phone.flv');
//$videolink=urlencode('phone.flv');
$player='components/com_youtubegallery/includes/player_flv_maxi.swf';
$result='<div style="position: relative;width:'.$width.'px;height:'.$height.'px;margin:0px;padding:0px;'.$cssstyle.'" class="YoutubeGalleryFLVThumbs">';
$result.='<div style="position: absolute;background-image: url(\'/components/com_youtubegallery/images/dot.png\');top:0px;left:0px;width:'.$width.'px;height:'.$height.'px;margin:0px;padding:0px;">';
//http://flv-player.net/players/maxi/license/
$result.='<object type="application/x-shockwave-flash" data="'.$player.'" width="'.$width.'" height="'.$height.'" style="margin:0 !important;padding: 0 !important;border:none !important;">
<param name="movie" value="'.$player.'" />';
/*
<param name="autoload" value="1" />
<param name="loop" value="1" />
<param name="phpstream" value="0" />
<param name="showloading" value="never" />
*/
$p='&autoload=1&showplayer=never&buffermessage=&skin=';
$p.='&autoplay=1';
$p.='&loop=1';
$p.='&margin=0';
$p.='&onclick='.urlencode($aLink);
$p.='&onclicktarget='.$linkTarget;
$result.='<param name="FlashVars" value="flv='.$videolink.$p.'" />'
.'</object></div>
<div style="position: absolute;background-image: url(\'components/com_youtubegallery/images/dot.png\');top:0px;left:0px;width:'.$width.'px;height:'.$height.'px;margin:0px;padding:0px;"></div>
</div>
';
/*
*/
return $result;
}
static function getThambnailSize($cssstyle)
{
$size=array(120,90);
$s=explode(';',$cssstyle);
$c=0;
foreach($s as $a)
{
$p=explode(':',$a);
if(count($p)>0)
{
$o=strtolower($p[0]);
if($o=='width')
{
$c+=1;
$size[0]=trim(str_replace('px','',strtolower($p[1])));
}
if($o=='height')
{
$c+=1;
$size[1]=trim(str_replace('px','',strtolower($p[1])));
}
}
if($c==2)
break;
}
return $size;
}
public static function renderFLVPlayer($options, $width, $height, &$videolist_row, &$theme_row, $videolink)
{
//FLV Player
//$videolinkkeyword='****youtubegallery-video-link****';
$player='components/com_youtubegallery/includes/player_flv_maxi.swf';
$playerid='youtubegalleryplayerid_'.$videolist_row->id;
$title='';
if(isset($options['title']))
$title=$options['title'];
$settings=array();
$settings[]=array('autoplay',(int)$options['autoplay']);
//$settings[]=array('controls',$options['controls']);
$settings[]=array('loop',(int)$options['repeat']);
if($options['color1']!='')
$settings[]=array('bgcolor1',$options['color1']);
if($options['color2']!='')
$settings[]=array('bgcolor2',$options['color2']);
if($options['controls']!='')
{
if($options['controls']==0)
$settings[]=array('showplayer','never');
else
$settings[]=array('showplayer','autohide');
}
$settings[]=array('showfullscreen',$options['fullscreen']);
$settings[]=array('showloading','always');
$settings[]=array('autoload','1');
$settings[]=array('buffermessage','');
$settings[]=array('skin','');
if($theme_row->border)
{
$settings[]=array('playercolor',$options['color1']);
$settings[]=array('margin','5');
}
else
$settings[]=array('margin','0');
YouTubeGalleryMisc::ApplyPlayerParameters($settings,$options['youtubeparams']);
$result='';
//http://flv-player.net/players/maxi/license/
$result.='<div style=""><object type="application/x-shockwave-flash" id="'.$playerid.'" alt="'.$title.'" data="'.$player.'" width="'.$width.'" height="'.$height.'" '
.'style="margin:0 !important;padding: 0 !important;border:none !important;">'
.($theme_row->responsive==1 ? ' onLoad="YoutubeGalleryAutoResizePlayer'.$videolist_row->id.'();"' : '')
.'<param name="movie" value="'.$player.'" />';
$p='';
foreach($settings as $s)
$p.='&'.$s[0].'='.$s[1];
$result.='<param name="FlashVars" value="flv=../../../'.$videolink.$p.'" /></object></div>';
return $result;
}
}
?>