Changed crontab and only play audio on overlay video

other
Filip Borum Poulsen 1 year ago
parent db75cec203
commit c6318fd63a

@ -1,5 +1,11 @@
30 16 * * * /home/pi/video-player/start-projector.sh 30 16 * * 5,6,0 /home/pi/video-player/start-projector.sh
0 17 * * * /home/pi/video-player/play-overlay.sh 0 17 * * 5,6,0 /home/pi/video-player/play-overlay.sh
0 18 * * * /home/pi/video-player/play-overlay.sh 0 18 * * 5,6,0 /home/pi/video-player/play-overlay.sh
0 19 * * * /home/pi/video-player/play-overlay.sh 0 19 * * 5,6,0 /home/pi/video-player/play-overlay.sh
30 19 * * * /home/pi/video-player/stop-projector.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

@ -77,7 +77,7 @@ if (fs.existsSync('/selectedvideo')) {
function startVideo(path) { 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) => { // process.stdout.on('data', (data) => {
// console.log(`stdout: ${data}`); // console.log(`stdout: ${data}`);
@ -138,7 +138,14 @@ app.post("/select", (req, res) => {
}); });
app.post("/playoverlay", (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' }); res.json({ status: 'ok' });
}); });

@ -1,9 +1,5 @@
#!/bin/bash #!/bin/bash
/home/pi/video-player/relay-on.sh &
export DISPLAY=:0 export DISPLAY=:0
ffplay -fs -autoexit $(cat /overlayvideo) ffplay -fs -autoexit $(cat /overlayvideo)
/home/pi/video-player/relay-off.sh &

Loading…
Cancel
Save