summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-09-22 12:17:11 +0200
committerJonas Smedegaard <dr@jones.dk>2014-09-22 12:17:11 +0200
commit00a73b968e80df829b4f43e197a5481a3ca09d9c (patch)
tree3cae1f1c69fd8ab3cbe8158dbd07bf21aa0d36be /localvideowebencode
parent786cfa4c5f2ae1f3c0d40d6a389701115420fa28 (diff)
Fix bashism (dash ${} fails with newlines and drops double-quotes).
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode24
1 files changed, 13 insertions, 11 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 105554a..cd7fc96 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -391,19 +391,15 @@ __width="${_width:+ width=\"$_width\"}"
__height="${_height:+ height=\"$_height\"}"
# Flash object needs extra space for controllers
__heightplus=${_height:+ height=\"$(($_height+4))\"}
-__ogg=${ogg:+<source src=\"$stem.ogv\" type=\"video/ogg\" />
-}
-__webm=${webm:+<source src=\"$stem.webm\" type=\"video/webm\" />
-}
-__mp4=${mp4:+<source src=\"$stem.mp4\" type=\"video/mp4\" />
-}
+_source_ogg="<source src=\"$stem.ogv\" type=\"video/ogg\" />"
+_source_webm="<source src=\"$stem.webm\" type=\"video/webm\" />"
+_source_mp4="<source src=\"$stem.mp4\" type=\"video/mp4\" />"
# TODO: resolve flash player to use
[ -z "$flashplayer" ] || flash=yes
[ -n "$mp4" ] || [ -z "$flash" ] || error1 "Cannot enable flash when mp4 format is disabled."
-__flash=${flash:+<object$__width$__heightplus type=\"application/x-shockwave-flash\" data=\"$flashplayer.swf\">
-<param name=\"movie\" value=\"$flashplayer.swf\" />
-<param name=\"flashvars\" value=\"image=$stem.jpg&amp;file=$stem.mp4\" />
-}
+_object_flash="<object$__width$__heightplus type=\"application/x-shockwave-flash\" data=\"$flashplayer.swf\">"
+_param_name="<param name=\"movie\" value=\"$flashplayer.swf\" />"
+_param_flashvars="<param name=\"flashvars\" value=\"image=$stem.jpg&amp;file=$stem.mp4\" />"
__oggfile=${ogg:+open format <a href=\"$stem.ogv\">Ogg</a>}
__webmfile=${webm:+open format <a href=\"$stem.webm\">WebM</a>}
__mp4file=${mp4:+closed Format <a href=\"$stem.mp4\">MPEG-4</a>}
@@ -413,7 +409,13 @@ __mp4file=${mp4:+closed Format <a href=\"$stem.mp4\">MPEG-4</a>}
cat >"$stem.html" <<EOF
<!-- Video for Everybody, Kroc Camen of Camen Design -->
<video$__width$__height preload controls>
-$__mp4$__webm$__ogg$__flash<img src="$stem.jpg"$__width$__height alt="$title"
+${mp4:+$_source_mp4
+}${webm:+$_source_webm
+}${ogg:+$_source_ogg
+}${flash:+$_object_flash
+$_param_name
+$_param_flashvars
+}<img src="$stem.jpg"$__width$__height alt="$title"
title="No video playback capabilities, please download the video below" />
${flash:+</object>
}</video>