|
mms源在观看过程中会出现中断退出的现象,有时候是因为网络不通畅,有时候是节目本身的问题,比如, 日本索尼音乐台 mms://morrich.gekimedia.net/MainStream500, 一首歌唱完之后就会退出, 可以用循环语句实现退出后的重新连接,并用trap来捕捉Ctrl-C的停止信号。
#!/bin/bash
function play () { while : do mplayer -fs $go trap 'exit 1' 2 done }
clear echo -n " " echo -e '\E[47;44m'"\033[1mMy Favourite TV Channels List\033[0m" echo; echo echo -e "\033[1mChoose one of the following channels:\033[0m" echo "(Enter only the first letter of name.)" echo echo -en '\E[1;34m'"\033[1mO\033[0m" echo "lympics-cctv" echo -en '\E[1;35m'"\033[1mN\033[0m" echo "ews-cctv" echo -en '\E[1;32m'"\033[1mE\033[0m" echo "du-cctv10"
read tv case "$tv" in "O" | "o" ) go="mms://live.cctv.com/live15" ;; "N" | "n" ) go="mms://live.cctv.com/livenews" ;; "E" | "e" ) go="mms://live.cctv.com/live20" ;; *) echo echo "Not yet in database." exit 0 ;; esac echo play
|