BACK in December we started recording and sharing many videos. Almost 40 gigabytes later, and having created .gif (GIF) animations with previews, we can now automatically produce clickable video galleries (screenshot above), more or less like YouTube sans the text and sans the JavaScript.
"Putting videos on YouTube isn't free; the cost is hidden and becoming a slave of masters like Facebook or Google is a huge cost."The implementation is extremely simple and generally occurred to me as a reasonable possibility when I was in the kitchen a few weeks ago. Rather than attempt to do anything fancy with JavaScript the previews can be done 'offline', then uploaded with the same filename as the WebM file, except the extension. We already explained how to streamline the GIF file. That was 20 days ago. Once you have enough GIF files in place, try something like this (for our setup it's all in ~/public_html/videos/
):
cd ~/public_html/videos/ find *.gif > /tmp/gif sed 's/.gif//' /tmp/gif > /tmp/gif-raw
echo '' > ~/public_html/videos/index.html while IFS= read -r line; do echo "<a href=\"$line.webm\"><img width=\"300\" hspace=\"20\" vspace=\"20\" style=\"padding: 17px 17px 17px 17px; box-shadow: 5px 5px 5px #222;\" src=\"$line.gif\" alt=\"$line\" /></a>" >> ~/public_html/videos/index.html done < /tmp/gif-raw
cat
for concatenation). Appending and prepending bits of HTML: