]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Mar 2012 18:34:36 +0000 (18:34 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Mar 2012 18:34:36 +0000 (18:34 +0000)
inc/commons/class.common.tools.php

index cc08ce1cd248c0092defa37aa3fb3c9e66e452b2..08a9edc8b270f44ff784142f6aaf68e144b9cff7 100644 (file)
@@ -24,7 +24,7 @@ class commonTools {
 
        public static function urlDecoder($args) {
                global $js;
-               $js[] = JS_PATH.'/urldecoder.js';
+               $js[] = JS_PATH . '/urldecoder.js';
 
                global $core;
                $res = commonPage::barre();
@@ -70,20 +70,22 @@ class commonTools {
                $loop = isset($_GET['loop']) ? $_GET['loop'] : 0;
                $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';
 
                $fv = array('video' => $url,
                        'autoPlay' => $autoplay == 1,
                        'controls' => $controls == 1,
                        'loop' => $loop == 1);
 
-               if (file_exists($dir . 'video.jpg')) {
+               if ($displayPoster && file_exists($dir . 'video.jpg')) {
                        $poster = $web . 'video.jpg';
                        $fv['poster'] = 'http://' . $_SERVER['HTTP_HOST'] . $poster;
                }
 
                $res = '<style type="text/css">';
                $res.='html, body {margin: 0;padding: 0;height: 100%;color:#fff;overflow:hidden;}';
-               $res.='body{background:#000;}';
+               $res.='body,video{background:' . $background . ';}';
                $res.='video{width:100%;height:100%;}';
                $res.='#header{display:none;}';
                $res.='</style>';
@@ -93,19 +95,25 @@ class commonTools {
                        $alt.=' controls="controls"';
                }
                if ($loop) {
-                       $alt.=' loop="loop"';
+                       $alt.=' onended="this.play();"';
+                       //$alt.=' loop="loop"';
                }
                if ($autoplay) {
                        $alt.=' autoplay="autoplay"';
                }
-               if (isset($poster)) {
+               if ($displayPoster && isset($poster)) {
                        $alt.=' poster="' . $web . 'video.jpg"';
                }
                $alt .= '>';
                $alt .= '</video>';
 
 
-               $res .= cubeMedia::flash2('/swf/video.swf', '100%', '100%', $fv, 'video', '', 10, '#000000', $alt, true);
+               if (isset($_GET['html5']) && $_GET['html5']) {
+                       $res.='<div id="video">' . $alt . '</div>';
+               } else {
+                       $res .= cubeMedia::flash2('/swf/video.swf', '100%', '100%', $fv, 'video', '', 10, '#000000', $alt, true);
+               }
+
 
                //ob_end_clean();
                echo $res;