]> git.plutz.net Git - serve0/blobdiff - view.sh
Implemented video view page with stereoscopic options
[serve0] / view.sh
diff --git a/view.sh b/view.sh
new file mode 100644 (file)
index 0000000..baaad11
--- /dev/null
+++ b/view.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+. "$_EXEC/indexmeta.sh"
+. "$_EXEC/widgets.sh"
+
+read length width height tags comment short <<-EOF
+       $(meta_info "$_DATA/$ITEM")
+       EOF
+
+printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
+
+{ printf '
+[!DOCTYPE HTML]
+[html [head [title Listing]
+  [meta name="viewport" content="width=device-width"]
+  [link rel=stylesheet href="/style.css" ]
+] [body #view
+  [script type="text/javascript" src="/stereoview.js"\n]
+  [div #navigation
+    [a #t_bookmarks href="#bookmarks" &#x2605;]'
+    w_search
+    printf '
+    [a #t_avsearch href="#advsearch" Advanced]
+    [a #t_prefs href="#prefs" &#x2699;]
+  ]'
+  w_bookmarks
+  w_advsearch
+  w_prefs
+  printf '
+  [h1\n %s]
+  [a "?a=download" Download]
+  [a "javascript:stereoview(180, document.getElementById(&#34;mainvideo&#34;));" View 180° Stereoscopic]
+  [a "javascript:stereoview(360, document.getElementById(&#34;mainvideo&#34;));" View 360° Stereoscopic]
+  [video #mainvideo controls="controls" [source src="?a=download" type="video/mp4"]]
+  [span .time %i:%imin] [span .dim %ix%i] %s
+  ' "$(HTML "${ITEM##*/}")" \
+    "$((length / 60))" "$((length % 60))" "$width" "$height" \
+    "$(printf '%s\n' "${tags#tags=}" |sed -r "$UNSTRING"'
+       s;^;,;; s;,+;,;g; s;,$;;; :X s;,([^,]+)(,|$); [span .tag\n \1]\2;; tX;'
+    )"
+  printf '
+  [div #editing
+    [form method=POST action="?a=multitag"'
+      [ -d "$_DATA/${ITEM%/*}/.index/" ] && w_tagging
+    printf '
+    ]
+  ]
+] ]
+'; } | "$_EXEC/cgilite/html-sh.sed"