From efefeef8289f064b3875b9bae1d1b007f5c1d5f8 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 28 Nov 2016 20:20:37 +0000 Subject: [PATCH] extending cooperation functions svn path=/trunk/; revision=157 --- actions/watch.sh | 12 ++++++------ pages/playctl.sh | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/actions/watch.sh b/actions/watch.sh index 7db9c64..cc47088 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -2,6 +2,7 @@ cgi_refdata info="${_GET[i]}" +watch="${_GET[w]:-${_COOKIE[watch]}}" location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)" order="${_POST[o]}" search="${_POST[s]}" @@ -33,11 +34,10 @@ else videourl="$(urlsafe "videos/$info")" fi -case "${_COOKIE[watch]}" in +case "$watch" in raspi) - rpiaddr="http://pfostenpanne.helmchyn.no-ip.biz/?player=play&path=" - [ $height -gt 480 -a $width -gt 480 ] && redirect "${rpiaddr}$(urlsafe "http://jupiter:8000/?action=transcode&i=${linkinfo}&t=480")" \ - || redirect "${rpiaddr}$(urlsafe "http://jupiter:8000/${videourl}")" + rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&w=server&i=" + redirect "${rpiaddr}$(urlsafe "http://jupiter:8000/${videourl}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \ @@ -77,13 +77,13 @@ case "${_COOKIE[watch]}" in export XDG_RUNTIME_DIR="/run/user/$uid" # required for Pulseaudio xrandr >/dev/null # helps enable all screens - # nohup /usr/bin/mplayer -ao pulse \ + # nohup /usr/bin/mplayer \ # -slave -input file="$fifofile" \ # -volume "$volume" \ # "$playuri" >"$statusfile" 2>/dev/null & # MPlayer2: (statusline on stderr) - nohup /usr/bin/mplayer -ao pulse \ + nohup /usr/bin/mplayer \ --slave --input=file="$fifofile" \ --volume="$volume" \ "$playuri" 2>"$statusfile" >/dev/null & diff --git a/pages/playctl.sh b/pages/playctl.sh index eb75304..a4c5bbe 100755 --- a/pages/playctl.sh +++ b/pages/playctl.sh @@ -38,11 +38,13 @@ volume=$(validate "$(cat "$_DATA/mplayer.volume")" '[1-9]?[0-9]|100' 20) debug VIDEO: $video pa_sinks(){ - export DISPLAY=":0" - export XDG_RUNTIME_DIR="/run/user/$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')" + if which pactl >/dev/null; then + export DISPLAY=":0" + export XDG_RUNTIME_DIR="/run/user/$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')" - pactl list sinks \ - | sed -rn '/Sink #/{:X;N;/Description: /!bX;s;Sink #([0-9]+).+Description: (.*);\1 \2;p}' + pactl list sinks \ + | sed -rn '/Sink #/{:X;N;/Description: /!bX;s;Sink #([0-9]+).+Description: (.*);\1 \2;p}' + fi } printf 'Refresh: 1\r\n' -- 2.39.2