#!/bin/bash


MPLIST=`ls *.mp4`
MOVLIST=`ls *.mov`


if [ -e index.htm ]
then
  rm index.htm
fi 

echo "<!DOCTYPE HTML>" > index.htm
echo "<html>" >> index.htm
echo "<body>" >> index.htm




for index in $MPLIST
do
  echo "<video width="320" height="240" controls="controls">" >> index.htm
  echo "   <source src=\"$index\" type="video/mp4">" >> index.htm
  echo "</video>" >> index.htm
done

for index in $MOVLIST
do
  echo "<video width="320" height="240" controls="controls">" >> index.htm
  echo "   <source src=\"$index\" type="video/mov">" >> index.htm
  echo "</video>" >> index.htm
done


echo "</body>" >> index.htm
echo "</html>" >> index.htm
