]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Mon, 16 Mar 2020 07:34:23 +0000 (08:34 +0100)
committerVincent <vincent@enhydra.fr>
Mon, 16 Mar 2020 07:34:23 +0000 (08:34 +0100)
.idea/workspace.xml
config/lit.php
config/sdb.php
config/tv.php
js/home.js
scripts/lib/lib.php
scripts/lib/mediarasp.php
scripts/mediarasp.php

index 112c468b613db565ecace9a287bf13223821d93b..b9a126baefca595b7bc37756ce769f772efc7cff 100644 (file)
@@ -3,9 +3,13 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/media.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/lit.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/lit.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/tv.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/tv.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/mediarasp.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1583403852883" duration="5927000" />
       <workItem from="1583566881341" duration="3483000" />
       <workItem from="1583911211830" duration="1508000" />
-      <workItem from="1584000517438" duration="1448000" />
-    </task>
-    <task id="LOCAL-00265" summary=".">
-      <created>1578040991600</created>
-      <option name="number" value="00265" />
-      <option name="presentableId" value="LOCAL-00265" />
-      <option name="project" value="LOCAL" />
-      <updated>1578040991600</updated>
+      <workItem from="1584000517438" duration="2051000" />
+      <workItem from="1584004039571" duration="881000" />
+      <workItem from="1584286469208" duration="9323000" />
     </task>
     <task id="LOCAL-00266" summary=".">
       <created>1578043868577</created>
       <option name="project" value="LOCAL" />
       <updated>1583689851384</updated>
     </task>
-    <option name="localTasksCounter" value="314" />
+    <task id="LOCAL-00314" summary=".">
+      <created>1584002002804</created>
+      <option name="number" value="00314" />
+      <option name="presentableId" value="LOCAL-00314" />
+      <option name="project" value="LOCAL" />
+      <updated>1584002002805</updated>
+    </task>
+    <option name="localTasksCounter" value="315" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="92" y="92" width="2376" height="856" key="DiffContextDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1580377344165" />
-    <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1578038647334">
+    <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1584290302981">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="836" y="443" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577363498855" />
-    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1578038647334" />
+    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1584290302981" />
     <state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1583689982170">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1583689982170" />
-    <state x="980" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1584000517418">
+    <state x="980" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1584286471205">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
     <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1582201881167" />
-    <state x="980" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1584000517418" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1583911655372">
+    <state x="980" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1584286471205" />
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1584293196498">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
     <state x="733" y="287" width="607" height="598" key="find.popup/0.0.1920.1160@0.0.1920.1160" timestamp="1582125776502" />
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1583911655372" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1584293196498" />
     <state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="936" y="240" key="run.anything.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578386519646" />
+    <state x="943" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1584289936754">
+      <screen x="0" y="0" width="2560" height="1040" />
+    </state>
+    <state x="943" y="225" width="672" height="678" key="search.everywhere.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1584289936754" />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
index b67c0076e9d3a85e5640845170491bed8b3c7954..c0d63c441c6e32a0e6dd54ea4400adf065631648 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 config('ROOM_NAME', 'Lit');
 config('ROOM', 'chambre');
-config('VIDEOPLAYER', 'mediarasp');
-config('TVPLAYER', 'mediarasp');
+config('VIDEOPLAYER', 'mediarasp-small');
+config('TVPLAYER', 'mediarasp-small');
 config('HIDEMASK_TIMEOUT', 250);
 
 if (DISPLAYINTERFACE) {
index 431ed3d41ee3b865ccd1522c7d5d83b8e61e35cd..505f20a05763db53ff5a4cf88687dd7782b69ff5 100644 (file)
@@ -6,8 +6,8 @@ config('SLEEPSCREEN', 30);
 config('SCREENSAVER_BRIGHTNESS', 100);
 config('SLEEPTYPE', 'screensaver');
 config('SCREENSAVER','weatherstation');
-config('VIDEOPLAYER', 'mediarasp');
-config('TVPLAYER', 'mediarasp');
+config('VIDEOPLAYER', 'mediarasp-small');
+config('TVPLAYER', 'mediarasp-small');
 config('VOLUME', 60);
 config('VOLUME_DEVICE', 'RaspberryPi');
 config('HIDEMASK_TIMEOUT',250);
index db1c602b74bfccccf3ee57a463fb3f6ea39cdd1e..1a8d7aa7be27931facd7e945ef92562097beb93b 100644 (file)
@@ -1,21 +1,21 @@
 <?php
-//$mapdvb = connectRedis()->igbget('dvbchannels');
-//if (!$mapdvb) {
-//    $mapdvb = array();
-//    $m3u = getUrlContent('http://192.168.13.60:9981/playlist/channels', 30);
-//    $lines = explode("\n", $m3u);
-//    $name = '';
-//    foreach ($lines as $line) {
-//        $line = trim($line);
-//        if (strpos($line, '#EXTINF:') === 0) {
-//            $e = explode(',', $line);
-//            $name = array_pop($e);
-//        } else if (strpos($line, 'http') === 0) {
-//            $mapdvb[$name] = $line;
-//        }
-//    }
-//    connectRedis()->igbsetex('dvbchannels', 3600, $mapdvb);
-//}
+$mapdvb = connectRedis()->igbget('dvbchannels');
+if (!$mapdvb) {
+    $mapdvb = array();
+    $m3u = getUrlContent('http://192.168.13.60:9981/playlist/channels', 30);
+    $lines = explode("\n", $m3u);
+    $name = '';
+    foreach ($lines as $line) {
+        $line = trim($line);
+        if (strpos($line, '#EXTINF:') === 0) {
+            $e = explode(',', $line);
+            $name = array_pop($e);
+        } else if (strpos($line, 'http') === 0) {
+            $mapdvb[$name] = $line;
+        }
+    }
+    connectRedis()->igbsetex('dvbchannels', 3600, $mapdvb);
+}
 
 $tv = array(
     'Replay' => array('freebox' => 'replay'),
@@ -66,7 +66,13 @@ foreach ($tv as $name => $service) {
     if (is_numeric($name)) {
         $shortcuts['sub-tv'][] = array('type' => 'separator', 'label' => $service);
     } else {
-        if ($tvplayer == 'omxplayer' || $tvplayer == 'mediarasp' || $tvplayer == 'vlciframe') {
+        if ($tvplayer == 'freebox') {
+            if (isset($service['channel'])) {
+                $shortcuts['sub-tv'][] = array('type' => 'freebox', 'url' => 'scripts/freeboxchannel.php?channel=' . $service['channel'], 'label' => $name);
+            } else {
+                $shortcuts['sub-tv'][] = array('type' => 'freebox', 'url' => 'scripts/freeboxchannel.php?menu=' . $service['freebox'], 'label' => $name);
+            }
+        } else {
             $e = explode(':', $service['stream'], 3);
             $protocol = $e[0];
             $id = $e[1];
@@ -79,21 +85,13 @@ foreach ($tv as $name => $service) {
                 }
             }
 
-            $type = $tvplayer == 'vlciframe' ? 'vlciframe' : 'omx';
-
             if ($protocol == 'fbx') {
-                $shortcuts['sub-tv'][] = array('type' => $type, 'url' => 'rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=' . $id . $definition, 'label' => $name);
+                $shortcuts['sub-tv'][] = array('type' => 'media', 'url' => 'rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=' . $id . $definition, 'label' => $name);
             } else {
                 if (isset($mapdvb[$id])) {
-                    $shortcuts['sub-tv'][] = array('type' => $type, 'url' => $mapdvb[$id], 'label' => $name);
+                    $shortcuts['sub-tv'][] = array('type' => 'media', 'url' => $mapdvb[$id], 'label' => $name);
                 }
             }
-        } elseif ($tvplayer == 'freebox') {
-            if (isset($service['channel'])) {
-                $shortcuts['sub-tv'][] = array('type' => 'freebox', 'url' => 'scripts/freeboxchannel.php?channel=' . $service['channel'], 'label' => $name);
-            } else {
-                $shortcuts['sub-tv'][] = array('type' => 'freebox', 'url' => 'scripts/freeboxchannel.php?menu=' . $service['freebox'], 'label' => $name);
-            }
         }
     }
 }
index d377fc915f2c4c109a878374890cb24deffdde62..c70e0ff93aba52f09e6729ac03de363aa5f5eaff 100644 (file)
@@ -163,18 +163,32 @@ $(function () {
     });
 
     $(document).on(clickevent, '.media', function () {
-        if (CONFIG.VIDEOPLAYER === 'omxplayer') {
-            var path = '/mnt/share' + $(this).attr('href');
-            omxplayer(path, false);
-            return false;
-        } else if (CONFIG.VIDEOPLAYER === 'mediarasp') {
-            displayLoader($(this));
-            $.get('/scripts/mediarasp.php?action=play&device=' + CONFIG.VIDEOPLAYER_DEVICE + '&file=' + encodeURIComponent('/nas' + $(this).attr('href')), function () {
-                window.location = '#/section/remote';
-                hideLoader();
-            });
-            return false;
+        displayLoader($(this));
+        if (CONFIG.VIDEOPLAYER === 'mediarasp-small') {
+            stopSqueeze();
+            screenOn(true);
+            resize();
+            videoPlaying = true;
+            $("#scrollholder").scrollLeft(0);
+            screenOn(true);
+        }
+
+        var href = $(this).attr('href');
+        var attr;
+        if (href.indexOf('://') === -1) {
+            attr = '&file=' + encodeURIComponent('/nas' + href);
+        } else {
+            attr = '&url=' + encodeURIComponent(href);
+        }
+        if (CONFIG.VIDEOPLAYER === 'mediarasp-small') {
+            attr += '&small=1';
         }
+
+        $.get('/scripts/mediarasp.php?action=play&device=' + CONFIG.VIDEOPLAYER_DEVICE + attr, function () {
+            window.location = '#/section/remote';
+            hideLoader();
+        });
+        return false;
     });
 
     $(document).on(clickevent, '.harmonyactivity', function () {
@@ -197,12 +211,6 @@ $(function () {
         return false;
     });
 
-    $(document).on(clickevent, 'a.omx', function () {
-        var $this = this;
-        omxplayer($(this).attr('href'), true);
-        return false;
-    });
-
     $(document).on(clickevent, '[data-screenoff]', function () {
         screenOff();
         return true;
@@ -400,26 +408,6 @@ function changeAddress() {
     }
 }
 
-function omxplayer(url, live) {
-    stopSqueeze();
-    screenOn(true);
-    var videoHeight = (videoWidth / 16) * 9;
-    var videoTop = Math.round(($(window).outerHeight() - videoHeight) / 2);
-    var videoBottom = Math.round(videoTop + videoHeight);
-    // if (CONFIG.DEVICE === 'sdb') {
-    //     $.get('/scripts/light.php?scene=sdb/ampli/on');
-    // }
-    // var cmd = '/bin/echo "/usr/bin/omxplayer --win \'' + videoLeft + ' ' + videoTop + ' 800 ' + videoBottom + '\' -o local --vol -1350 --display 0 \\"' + url + '\\"" | /usr/bin/at now';
-    //sshCommand(cmd, true);
-
-    $.get('/scripts/mediarasp.php?url=' + encodeURIComponent(url) + '&action=play');
-
-    resize();
-    videoPlaying = true;
-    $("#scrollholder").scrollLeft(0);
-    screenOn(true);
-}
-
 function runSSHQueue() {
     if (sshQueue.length == 0) {
         return;
index ef29f150c021349cfa1c83623995f71d8e14cfb6..60de2734b2c7a4f64d032ade112a107094c923d7 100644 (file)
@@ -286,7 +286,7 @@ function shortcut($s, $hash)
         $attrs['href'] = 'scripts/phonetask.php?phone=' . $s['phone'] . '&task=' . trim(base64_encode($s['task']), "=");
         $attrs['class'] = 'ajax';
     } elseif ($s['type'] == 'media') {
-        $attrs['href'] = $s['path'];
+        $attrs['href'] = isset($s['path']) ? $s['path'] : $s['url'];
         $attrs['class'] = 'media';
     } elseif ($s['type'] == 'freebox') {
         $attrs['href'] = $s['url'];
index fa0c5bc07040879f79dc85a279e2768109dc9b34..69b956d05cee4233acda0e5a4eb6fb8431b3d3e8 100644 (file)
@@ -228,6 +228,16 @@ function sendHotKey($key, $times = 1, $device = null)
     return sshCommand('DISPLAY=:0 xdotool getactivewindow' . $keys, $device, true, false);
 }
 
+function moveVLC($fullscreen = true, $device = null)
+{
+    if ($fullscreen) {
+        $e = '0,0,800,480';
+    } else {
+        $e = '163,128,414,224';
+    }
+    return sshCommand('DISPLAY=:0 wmctrl -r "VLC" -e 0,' . $e . ';DISPLAY=:0 wmctrl -i -r "VLC" -b add,above;DISPLAY=:0 /usr/local/bin/removeallborders', $device, true, false);
+}
+
 function remoteCmdSalonMusique($cmd)
 {
     switch ($cmd) {
@@ -294,7 +304,7 @@ function addSeen($movie)
 
     $cacheFile = ROOT . '/cache/seen.json';
     if (!count($seen)) {
-        $seen = json_decode(file_get_contents($cacheFile),true);
+        $seen = json_decode(file_get_contents($cacheFile), true);
     }
 
     $seen[str_replace('/nas/', '/volume1/Share/', $movie)] = true;
index cb1826239439bd619aa2c2c000867569e94ce1c2..d6d768730562efd514c210fc4e7bad14ac1495df 100644 (file)
@@ -14,4 +14,9 @@ if ($_GET['action'] == 'play') {
         mediaRaspPlayCast($_GET['cast'], $_GET['device']);
     }
     echo getPlaying($_GET['device']);
+}
+
+if ($_GET['small'] == 1) {
+    sleep(3);
+    moveVLC(false);
 }
\ No newline at end of file