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" \
#!/bin/zsh
-# Copyright 2014, 2016 Paul Hänsch
+# Copyright 2014, 2016, 2017 Paul Hänsch
#
# This file is part of Serve0.
#
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
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"
<div id="playctl">
<h1>$info</h1>
- <form action="?action=playctl" method="post" class="playctl">
- <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
+ <form action="${actionuri}" method="post" class="playctl">
+ <input type="hidden" name="referrer" value="$(attribsafe "//${HTTP_HOST}${REQUEST_URI}")">
<fieldset class="playback">
<button type="submit" name="seek" value="-60"><<<</button>
<button type="submit" name="seek" value="-10"><<</button>