]> git.plutz.net Git - serve0/blobdiff - actions/watch.sh
extending cooperation functions
[serve0] / actions / watch.sh
index 7db9c645db6b1ea6aaf5fd57898effc7e53f36d5..cc47088c0bebc5e73c1b13895a307db1dd51e896 100755 (executable)
@@ -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 &