<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/scripts/youtubedl-download.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/gradient.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/gradient.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/lib/raspberrycast.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/raspberrycast.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/youtubedl-download.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/youtubedl-download.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1577378088885" duration="2201000" />
<workItem from="1577380387468" duration="866000" />
<workItem from="1577785483253" duration="3506000" />
- <workItem from="1577891426611" duration="4801000" />
- </task>
- <task id="LOCAL-00214" summary=".">
- <created>1566737418166</created>
- <option name="number" value="00214" />
- <option name="presentableId" value="LOCAL-00214" />
- <option name="project" value="LOCAL" />
- <updated>1566737418166</updated>
+ <workItem from="1577891426611" duration="5672000" />
</task>
<task id="LOCAL-00215" summary=".">
<created>1566808495062</created>
<option name="project" value="LOCAL" />
<updated>1578036926863</updated>
</task>
- <option name="localTasksCounter" value="263" />
+ <task id="LOCAL-00263" summary=".">
+ <created>1578039845044</created>
+ <option name="number" value="00263" />
+ <option name="presentableId" value="LOCAL-00263" />
+ <option name="project" value="LOCAL" />
+ <updated>1578039845044</updated>
+ </task>
+ <option name="localTasksCounter" value="264" />
<servers />
</component>
<component name="TodoView">
</state>
<state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
<state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1576479992407" />
- <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1578036915321">
+ <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1578039839316">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
<state x="701" y="127" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1575647157027" />
- <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1578036915321" />
+ <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1578039839316" />
<state x="1114" y="443" key="NewPhpFileDialog" timestamp="1578038647334">
<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="1575647093028" />
<state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1577891427221" />
- <state x="976" y="257" width="607" height="536" key="find.popup" timestamp="1578037318294">
+ <state x="976" y="257" width="607" height="536" key="find.popup" timestamp="1578040021331">
<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="976" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578037318294" />
+ <state x="976" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578040021331" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
css.backgroundImage = 'none';
//videoURL = data.data.video_path;
videoURL = data.data.video_path.replace('/nas/', 'file:///Z:/');
+ startVideo = 1;
+ if (data.data.start) {
+ startVideo = data.data.start;
+ }
}
if (videoURL === false) {
$('.video-background video').attr('src', videoURL);
var video = $('.video-background video').get(0);
video.pause();
- video.currentTime = 25;
+ video.currentTime = startVideo;
video.play();
}
//$type = 'image';
//$res = ['image' => '/images/ambiance/floral.jpg', 'position' => '50% 50%'];
$type = 'youtube';
- $res = ['videoid' => 'R3AKlscrjmQ'];
+ $res = ['videoid' => 'R3AKlscrjmQ', 'start' => 5];
break;
case 'savane':
$type = 'image';
// $type = 'image';
// $res = ['image' => '/images/ambiance/borealis.jpg', 'position' => '50% 100%'];
$type = 'youtube';
- $res = ['videoid' => 'T75IKSXVXlc'];
+ $res = ['videoid' => 'T75IKSXVXlc', 'start' => 5];
break;
case 'tropical':
$type = 'youtube';
- $res = ['videoid' => 'tYfsxnDTpcI'];
+ $res = ['videoid' => 'tYfsxnDTpcI', 'start' => 5];
//$type = 'image';
//$res = ['image' => '/images/ambiance/clouds.jpg', 'position' => '50% 100%'];
break;
case 'lounge':
$type = 'youtube';
- $res = ['videoid' => 'jfttWulByFI'];
+ $res = ['videoid' => 'jfttWulByFI', 'start' => 5];
//$type = 'gradient';
//$res = ['#d442f4', '#ebc3f4'];
break;
// $type = 'image';
// $res = ['image' => '/images/ambiance/lapared.jpg', 'position' => '50% 50%'];
$type = 'youtube';
- $res = ['videoid' => 'xGlVPzmgpSM'];
+ $res = ['videoid' => 'xGlVPzmgpSM', 'start' => 5];
break;
case 'jellyfish':
$type = 'youtube';
- $res = ['videoid' => '95Tc8qIJRuI'];
+ $res = ['videoid' => '95Tc8qIJRuI', 'start' => 5];
break;
case 'sharks':
$type = 'youtube';
- $res = ['videoid' => 'ehC5kXA70Ao'];
+ $res = ['videoid' => 'ehC5kXA70Ao', 'start' => 10];
break;
case 'space':
$type = 'youtube';
// $res = ['videoid' => 'wnhvanMdx4s'];
- $res = ['videoid' => 'Xjs6fnpPWy4'];
+ $res = ['videoid' => 'Xjs6fnpPWy4', 'start' => 90];
break;
case 'off':
$type = 'off';
$res = ['#ffffff', '#ffffff'];
}
if ($type == 'youtube') {
- $res['video_path'] = downloadYoutubeDL('https://www.youtube.com/watch?v=' . $res['videoid'], 'webm');
+ $res['video_path'] = downloadYoutubeDL('https://www.youtube.com/watch?v=' . $res['videoid'], false, 'webm');
}
header('Content-type: application/json');
$r = ['type' => $type, 'data' => $res];
{
$rasps = ['entree', 'bureausun', 'litvincent', 'litjerome', 'sdb'];
if (in_array($device, $rasps)) {
-// OMXCmd(['action' => 'dbus', 'command' => 'volume', 'parameter' => '-12.0'])->getBody();
-// OMXCmd(['action' => 'dbus', 'command' => 'volume', 'parameter' => '-12.0'])->getBody();
-// OMXCmd(['action' => 'dbus', 'command' => 'setaspectmode', 'parameter' => 'stretch'])->getBody();
-// OMXCmd(['action' => 'dbus', 'command' => 'setvideopos', 'parameter' => '0 0 800 480'])->getBody();
+
}
}
return trim($res);
}
-function getYoutubeDLPath($url)
+function getYoutubeDLPath($url, $ext = 'mkv')
{
$hash = sha1($url);
- return "/nas/Videos/YoutubeDL/" . $hash . '.mkv';
+ return "/nas/Videos/YoutubeDL/" . $hash . '.' . $ext;
}
-function downloadYoutubeDL($url)
+function downloadYoutubeDL($url, $cast = true, $ext = 'mkv')
{
- $dest = getYoutubeDLPath($url);
+ $dest = getYoutubeDLPath($url, $ext);
$wip = $dest . '.wip';
if (!file_exists($dest)) {
if (!file_exists($wip)) {
- httpRequest('https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php?url=' . rawurldecode($url), 'get', [], null, 1);
+ httpRequest('https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php?url=' . rawurldecode($url) . '&ext=' . $ext, 'get', [], null, $cast ? 1 : 0);
+ if (!$cast) {
+ return $dest;
+ }
+ }
+ if ($cast) {
+ return getYoutubeDLCastURL($url);
}
- return getYoutubeDLCastURL($url);
} else {
return $dest;
}
return VLCCmd(['command' => 'in_play', 'input' => $fileorstream], $device, $timeout);
}
-function OMXCmd($params, $device = null, $timeout = 5)
-{
- global $devices;
- if (null === $device) {
- $device = config('DEVICE');
- }
- $d = $devices[$device];
-
- $client = getMediaRaspClient();
- try {
- $response = $client->post('http://' . $d['host'] . ':4321/index.php/index/', ['form_params' => $params, 'timeout' => $timeout]);
- } catch (Exception $e) {
- echo $d['host'] . print_r($params) . ':' . $e->getMessage();
- return false;
- }
- return $response;
-}
-
<?php
require_once "import.php";
$url = $_GET['url'];
+$ext=$_GET['ext'];
-$dest = getYoutubeDLPath($url);
+$dest = getYoutubeDLPath($url,$ext);
$wip = $dest . '.wip';
if (!file_exists($dest) && !file_exists($wip)) {
set_time_limit(0);