From b2720657620708b249cd2c71cf4e2324b15a911c Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 17 Mar 2017 14:44:34 +0000 Subject: [PATCH] slave remote player to local interface, so that tags can be processed svn path=/trunk/; revision=179 --- actions/watch.sh | 10 ++++++++-- pages/playctl.sh | 20 ++++++++++++++++---- templates/playctl.html.sh | 4 ++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/actions/watch.sh b/actions/watch.sh index 5aff945..f796009 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -36,8 +36,14 @@ fi case "$_COOKIE[watch]" in raspi) - rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch" - redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/${_POST[page]}")" + #rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch" + #redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/${_POST[page]}")" + ncat atoemchen 80 >&- <<-EOF + GET /?action=watch&url=$(urlsafe "http://${HTTP_HOST}/${videourl}") HTTP/1.1$(printf \\r) + Host: atoemchen$(printf \\r) + $(printf \\r) + EOF + redirect "?p=playctl&${watch_link}w=$(urlsafe "${_POST[page]}#${_GET[i]}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \ 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" diff --git a/templates/playctl.html.sh b/templates/playctl.html.sh index 1d439e5..5d01597 100755 --- a/templates/playctl.html.sh +++ b/templates/playctl.html.sh @@ -62,8 +62,8 @@ cat <

$info

-
- + +
-- 2.39.2