X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=pages%2Fplayctl.sh;fp=pages%2Fplayctl.sh;h=5fd5411323301fa7960475bc62b7c900f8c1da4a;hb=b2720657620708b249cd2c71cf4e2324b15a911c;hp=591efd6695d89c792edcca1cde960fc3d4f73e82;hpb=86e8f96af15808d921bba4e8daf3b3facbd00afd;p=serve0 diff --git a/pages/playctl.sh b/pages/playctl.sh index 591efd6..5fd5411 100755 --- a/pages/playctl.sh +++ b/pages/playctl.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014, 2016 Paul Hänsch +# Copyright 2014, 2016, 2017 Paul Hänsch # # This file is part of Serve0. # @@ -25,10 +25,16 @@ directory="${location%/*}" statusfile="$_DATA/mplayer.status" statusfile="/tmp/mplayer.status" -[ -n "$info" ] && video="${_DATA}/videos/$info" \ - || video="${treeroot%/}/${location#/}" +if [ -n "$info" ]; then + video="${_DATA}/videos/$info" + meta="${_DATA}/meta/${info}.meta" +else + video="${treeroot%/}/${location#/}" + meta="${treeroot%/}${location%/*}/.index/${location##*/}.meta" +fi + +[ -r "$meta" ] || meta="${_DATA}/mplayer.meta" -meta="${_DATA}/mplayer.meta" tags="$(sed -n '2p' "$meta")" description="$(sed -n '3,$p' "$meta")" head -n1 "$meta" |read length width height TITLE @@ -37,6 +43,12 @@ volume=$(validate "$(cat "$_DATA/mplayer.volume")" '[1-9]?[0-9]|100' 20) debug VIDEO: $video +if [ "$_COOKIE[watch]" = raspi ]; then + actionuri='//atoemchen/?action=playctl' +else + actionuri='?action=playctl' +fi + pa_sinks(){ if which pactl >/dev/null; then export DISPLAY=":0"