Originally Posted by Xiaopangzi
The following works to lauch mplayer streaming some URL by clicking it (from a list of such URLs in an .html or .txt file). It could use some improving, like including the useful part of mplayer's output (but no cache fill... etc).
# This is file /mnt/us/www/cgi-bin/mplay
# call using (replace host/stream/Station):
# <a href="http://localhost/cgi-bin/mplay?http://host/stream">Station</a>
echo 'Content-type: text/plain'
MPLAYER="nice -n$NICENESS $INSTALLDIR/mplayer -ao alsa -slave -quiet -input file=$FIFO"
test -z `pidof mplayer` || killall mplayer >/dev/null 2>&1
test -e $FIFO || mkfifo $FIFO
($MPLAYER -playlist "$1" >/dev/null 2>&1) &
echo "Now playing $1 ..."
I'm not really sure how to use this. How do I make an HTML page that can launch music files? What would that look like? Many thanks.