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';
$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 = '<style type="text/css">';
$res.='html, body {margin: 0;padding: 0;height: 100%;color:#fff;overflow:hidden;}';
- $res.='body,video{background:' . $background . ';}';
+ $res.='body,video{background:#' . $background . ';}';
$res.='video{width:100%;height:100%;display:none;}';
$res.='#header,#videoflash,#videohtml,#ajaxLoader{display:none;}';
$res.='</style>';
$res.=$video;
$res.=$flash;
- //ob_end_clean();
echo $res;
- //exit;
}
public static function browserInfos($args) {