DrakaSAN
Posts: 5
Joined: Mon Jul 29, 2013 10:29 am

omxplayer key binding through javascript/bash?

Mon Jul 29, 2013 10:38 am

Hi everyone
I m working on a automated TV on a raspberry pi.
The algorithm is quite simple:

A javascript/node.js app get all playlist/command...
But I m forced to start omxplayer through a .sh file:

app.js:

Code: Select all

...
exec('/home/pi/play.sh', [file], function (error, stdout, stderr){...});
...
play.sh:

Code: Select all

if pgrep omxplayer;
then 
    echo "AR"
else
    omxplayer $1 > dev/null
fi
Is there a way to either still have the keyboard sending the key to the omxplayer, or app.js to send command to omxplayer?

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: omxplayer key binding through javascript/bash?

Tue Sep 24, 2013 7:21 pm

SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Heater
Posts: 16092
Joined: Tue Jul 17, 2012 3:02 pm

Re: omxplayer key binding through javascript/bash?

Tue Sep 24, 2013 7:36 pm

surely you can run and control omxplayer, or any program, via the child_process module of node.js.

http://nodejs.org/api/child_process.html
Memory in C++ is a leaky abstraction .

Return to “Raspberry Pi OS”