From: vincent@cubedesigners.com Date: Thu, 1 Mar 2012 11:06:12 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1cb495ecf63970eff81d8f3ad869f089370ac777;p=cubeextranet.git --- diff --git a/fluidbook/tools/webvideo b/fluidbook/tools/webvideo index d0c24fdaa..5b98aab5b 100644 --- a/fluidbook/tools/webvideo +++ b/fluidbook/tools/webvideo @@ -3,6 +3,8 @@ filename=$(basename $1) extension=${filename##*.} filename=${filename%.*} +mp4w=$3 +mp4h=$4 echo 'making jpg' echo @@ -10,8 +12,6 @@ echo /usr/local/bin/ffmpeg -i $1 -y -r 1 -ss 00:00:04 -t 00:00:01 -f image2 $2/$filename.jpg - - if [ extension != "mp4" ] then echo 'making mp4' @@ -28,6 +28,7 @@ echo -subcmp 2 \ -subq 6 \ -strict experimental \ +-vf scale="640:trunc(320/a)*2" \ -coder 0 \ -trellis 0 \ -bf 0 \ diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index e1890bb8d..9aa07e8fa 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -443,6 +443,12 @@ class commonCore extends cubeCore { $db->demandes->administrateur('integer', 0, false); // Clés $db->demandes->primary('pk_demandes', 'demande_id'); + + // Table + $db->tube->url('varchar',128,false); + + + try { $dbi = new CubeDbStruct($this->con); $dbi->synchronize($db); diff --git a/inc/extranet/Controlleur/class.extranet.tools.php b/inc/extranet/Controlleur/class.extranet.tools.php index 7d9b57f25..5c62e33d3 100644 --- a/inc/extranet/Controlleur/class.extranet.tools.php +++ b/inc/extranet/Controlleur/class.extranet.tools.php @@ -22,6 +22,75 @@ class extranetTools { } } + public static function tube($args) { + global $css, $js; + + $css = array(); + $js[] = JS_PATH . '/tube.js'; + $js[] = JS_PATH . '/modernizr.js'; + + $url = $_GET['u']; + $hash = sha1($url); + + $web = '/tube/' . $hash . '/'; + $dir = ROOT . $web; + if (!file_exists($dir)) { + + mkdir($dir, 0777, true); + $ext = files::getExtension($url); + $original = $dir . 'video.' . $ext; + copy($url, $original); + + require_once ROOT . '/inc/ws/Util/class.ws.tools.php'; + wsTools::encodeWebVideos($original); + } + + + $loop = isset($_GET['loop']) ? $_GET['loop'] : 0; + $autoplay = isset($_GET['autoplay']) ? $_GET['autoplay'] : 0; + $controls = isset($_GET['controls']) ? $_GET['controls'] : 1; + + $fv = array('video' => $url, + 'autoPlay' => $autoplay == 1, + 'controls' => $controls == 1, + 'loop' => $loop == 1); + + if (file_exists($dir . 'video.jpg')) { + $poster = $web . 'video.jpg'; + $fv['poster'] = $poster; + } + + $res = ''; + + $alt = '