[MPlayer-users] mlayer-keyboard-remote-control

Sebastian Schoeps sebastian at schoeps.org
Tue Aug 6 11:50:01 CEST 2002


Hi,
I bought a multimedia-keyboard with these special internet-keys. to use 
them with mplayer i wrote a little shell-script to attach it to some keys.

it's not perfect, because one process of cat always remains in the memory. 
i don't know how to solve it. has anybody an idea?

i guess this script could later be useful for everybody... possibly it 
could be included in the mplayer tarball?!

Thanks
   Sebastian
-----------------------
#!/bin/bash
FIFO=/tmp/mplayer-remote

case $1 in
"launch")
  if (pidof mplayer); then echo "MPlayer already started!"; exit; fi;
  rm -f "$FIFO"
  mkfifo "$FIFO"
  while (pidof mplayer); do cat $FIFO; done | mplayer -slave "$2"
  rm "$FIFO";;

"pause")
  echo "pause" > "$FIFO";;

"play")
  echo "pause" > "$FIFO";;

"stop")
  echo "quit" > "$FIFO"
  ;;

"forward")
  echo "seek 150" > "$FIFO";;

"rewind")
  echo "seek -150" > "$FIFO";;

*)
  echo "MPlayer Control Version 0.5"
  echo "Allows you to control MPlayer remotely via shell-commands."
  echo "Usage: mplayerctrl [Option] Filename"
  echo "Options"
  echo "  launch:  launch mplayer and create Fifo"
  echo "  play:    play if playback is paused"
  echo "  pause:   pause if playback is paused"
  echo "  stop:    stop playback and quit"
  echo "  forward: Forward 60sec "
  echo "  rewind:  Rewind 60sec "
;;
esac 




More information about the MPlayer-users mailing list