diff --git a/crontab b/crontab old mode 100644 new mode 100755 index 1c54480..e6954cf --- a/crontab +++ b/crontab @@ -1,5 +1,11 @@ -30 16 * * * /home/pi/video-player/start-projector.sh -0 17 * * * /home/pi/video-player/play-overlay.sh -0 18 * * * /home/pi/video-player/play-overlay.sh -0 19 * * * /home/pi/video-player/play-overlay.sh -30 19 * * * /home/pi/video-player/stop-projector.sh +30 16 * * 5,6,0 /home/pi/video-player/start-projector.sh +0 17 * * 5,6,0 /home/pi/video-player/play-overlay.sh +0 18 * * 5,6,0 /home/pi/video-player/play-overlay.sh +0 19 * * 5,6,0 /home/pi/video-player/play-overlay.sh +30 19 * * 5,6,0 /home/pi/video-player/stop-projector.sh + +30 19 * * 5,6,0 /home/pi/video-player/relay-on.sh +30 16 * * 5,6,0 /home/pi/video-player/relay-off.sh + +0 7 * * * /home/pi/video-player/relay-on.sh +0 23 * * * /home/pi/video-player/relay-off.sh diff --git a/index.js b/index.js index b55c46a..f45bdb6 100755 --- a/index.js +++ b/index.js @@ -77,7 +77,7 @@ if (fs.existsSync('/selectedvideo')) { function startVideo(path) { - const newProcess = require('child_process').spawn('ffplay', ['-fs', '-loop', '2147483647', '-hide_banner', '-loglevel', 'error', path]); + const newProcess = require('child_process').spawn('ffplay', ['-fs', '-loop', '2147483647', '-hide_banner', '-an', '-loglevel', 'error', path]); // process.stdout.on('data', (data) => { // console.log(`stdout: ${data}`); @@ -138,7 +138,14 @@ app.post("/select", (req, res) => { }); app.post("/playoverlay", (req, res) => { - require('child_process').spawn('/home/pi/video-player/play-overlay.sh'); + const p = require('child_process').spawn('/home/pi/video-player/play-overlay.sh'); + // p.stdout.on('data', (data) => { + // console.log(`stdout: ${data}`); + // }); + + // p.stderr.on('data', (data) => { + // console.error(`stderr: ${data}`); + // }); res.json({ status: 'ok' }); }); diff --git a/play-overlay.sh b/play-overlay.sh index 990a4b8..8cacac7 100755 --- a/play-overlay.sh +++ b/play-overlay.sh @@ -1,9 +1,5 @@ #!/bin/bash -/home/pi/video-player/relay-on.sh & - export DISPLAY=:0 ffplay -fs -autoexit $(cat /overlayvideo) - -/home/pi/video-player/relay-off.sh &