summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>