#!/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"