Is it easy to control mplayer from another program?

I am setting up a computer running OpenBSD that I want to play all the music I will ever want. I want him to mostly go into the corner and do it. The problem is that I want to control her wherever I am. I can do this (although not very easy) with ssh from my computer. I think it would be great to control (such as songs, skip, pause, adjust the volume, etc.) from a simple web page so that I can access it from my phone as well as from my computer.

So, I would prefer to use mplayer for this. Is there a way to control mplayer, say a PHP script or something like that?

+8
scripting php mplayer openbsd
source share
2 answers

http://www.mplayerhq.hu/DOCS/tech/slave.txt

You can run mplayer in command receiving mode. First create a named pipe:

mkfifo /tmp/mplayercontrol mplayer -slave -input file=/tmp/mplayercontrol 

In turn, you can easily control it through PHP:

 file_put_contents("/tmp/mplayercontrol", "pause"); 

If you are running mplayer and PHP on the same server, this should already be done.

+14
source share

mplayer has a remote control interface (slave).

http://www.mplayerhq.hu/DOCS/tech/slave.txt

+4
source share

All Articles