My brain doesn't seem to want to work today. I am running vlc on a Raspberry Pi with a screen connected and mounted to the wall. I have a web page running with some simple controls to reboot the pi and switch to one of several vlc streams or stop streaming to show a website containing data. The problem I'm facing is getting the buttons to send a bash command to forward commands to the pipeline. eg. echo play >/tmp/vlc_command. these command work while on a remote terminal to do what I'm wanting, but not too familiar with PHP or Ajax. I know with PHP, the command that I want to send is shell_exec("echo play >/tmp/vlc_command") but I can't figure out how to tie it all together with the HTML element.
/tmp/vlc_command is a named pipeline I'm using to send commands to an instance of vlc running in the background.
- play - Starts the stream
- next - Next stream
- prev - Previous stream
- stop - Stops streaming (revealing a chromium kiosk window)
Note: I'm using <button> elements, I don't want to use <input> elements as they will break my design. If I don't need PHP, that's fine, I just need to execute a command in bash (linux command line).