Active Topics

 



Notices


Reply
Thread Tools
Posts: 296 | Thanked: 47 times | Joined on Oct 2009
#1
Hello everyone,

I'm using KMPlayer to play radio streams, which works pretty good.
I just have one annoyance:
When I'm in bad 3G coverage the stream stops playing and I have to manually unlock the device, press play, and so forth.
Is there a way to set KMPlayer to automatically retry playing the same stream?
If not, could the author of KMplayer implement this if he/she is reading this?
 
Posts: 122 | Thanked: 9 times | Joined on Feb 2010 @ France
#2
i have the same wish

I found a script to run the stream that i want to listen, which verify when the connection is done and when the mplayer socket is stops and restart the stream , but i cant execute it because i did nt found a way to install the dig

Code:
#!/bin/bash
declare p_pid
declare RHOST
RHOST=`dig LU-NT-STREAM01.bce.lu | grep "^LU-NT-STREAM01.bce.lu" | awk '{print $5}'`

play() {
    mplayer mms://LU-NT-STREAM01.bce.lu/Alpha989 &> /dev/null &
    sleep 2
    p_pid=`ps -ef | grep "[m]pla" | tail -n 1 | awk '{print $2}'`
}

cleanup() {
    kill -15 ${p_pid}
    sleep 5
    kill -9 ${p_pid} &> /dev/null
    unset p_pid
    unset RHOST
}

trap cleanup TERM
play

while [ 1 ]; do
    /bin/kill -0 ${p_pid} 2> /dev/null
    if [ $? -ne 0 ]; then
        netstat -an | grep $RHOST &> /dev/null
        while [ $? -eq 0 ]; do
            sleep 0.5
            netstat -an | grep $RHOST &> /dev/null
        done
        play
    fi
    sleep 0.1
done
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:45.