From: vincent@cubedesigners.com Date: Tue, 25 Nov 2014 17:54:20 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e0c6c3dfd91b0a6cce03cd9d7ed213023480125a;p=cubeextranet.git --- diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 559bfc6e3..32be77ce8 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -78,11 +78,32 @@ class commonTools { return $res; } + public static function tubeMeta($args) { + $url = $_GET['u']; + $hash = sha1($url); + + $web = '/tube/' . $hash . '/'; + $dir = ROOT . $web; + + header('Content-type: application/json'); + ob_end_clean(); + + $poster = $dir . 'video.jpg'; + if (file_exists($poster)) { + $dim = getimagesize($poster); + } + + $res = array('width' => $dim[0], + 'height' => $dim[1], + 'ratio' => round($dim[0] / $dim[1], 5)); + + echo json_encode($res); + exit; + } + public static function tube($args) { global $css, $js, $jsnomerge, $jsvar; - fb($_GET); - $css = array(); $js[] = JS_PATH . '/tube.js'; $jsnomerge[] = JS_PATH . '/flashdetect.js'; @@ -120,26 +141,26 @@ class commonTools { $autoplay = isset($_GET['autoplay']) ? $_GET['autoplay'] : 0; $controls = isset($_GET['controls']) ? $_GET['controls'] : 1; $displayPoster = isset($_GET['poster']) ? $_GET['poster'] : 1; - $background = isset($_GET['background']) ? $_GET['background'] : '#000000'; + $background = isset($_GET['background']) ? $_GET['background'] : '000000'; + $background = trim($background, '# '); $fv = array('video' => $url, 'autoPlay' => $autoplay == 1, 'controls' => $controls == 1, 'loop' => $loop == 1, - 'background' => trim($background, '#')); - + 'background' => $background); if (file_exists($dir . 'video.jpg')) { if ($displayPoster) { $poster = $web . 'video.jpg'; - $fv['poster'] = $web . $poster; + $fv['poster'] = $poster; } $dim = getimagesize($dir . 'video.jpg'); } $res = ''; @@ -170,9 +191,7 @@ class commonTools { $res.=$video; $res.=$flash; - //ob_end_clean(); echo $res; - //exit; } public static function browserInfos($args) {