Skip to content

Commit 36ad296

Browse files
marcosqlbiclaude
andcommitted
Loop the teaser
The video autoplays muted in a loop, with controls kept and autoplay removed under prefers-reduced-motion. Decision 19 records why the YouTube nocookie embed was rejected and what autoplay does to the bandwidth math. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 059a8e7 commit 36ad296

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

docs/decisions.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,19 @@ has nothing to adapt between, and the site collects no analytics anyway.
323323

324324
The two renditions and the poster live in `site/` (`teaser-av1.mp4`, `teaser-h264.mp4`,
325325
`teaser-poster.jpg`) and deploy with every site publish. The `<video>` element lists AV1
326-
first and H.264 as the universal fallback, is click-to-play (`preload="metadata"`), and
327-
costs page load only the poster. The 4K Camtasia master is kept outside the repository;
328-
re-encoding is two ffmpeg commands recorded in `docs/teaser/shot-script.md`. GitHub
329-
Pages' soft bandwidth limit is ~100 GB/month; only visitors who press play download a
330-
rendition, so the limit is far away at this site's traffic.
326+
first and H.264 as the universal fallback, and plays automatically — muted, looping,
327+
with controls kept visible — because the ink only reads in motion. A visitor whose
328+
system asks for reduced motion gets the poster and a play button instead: a small
329+
script removes the autoplay. A YouTube `nocookie` embed was considered for the loop and
330+
rejected — its privacy-enhanced mode only defers cookies until playback, which an
331+
autoplaying loop triggers on page load for everyone.
332+
333+
The 4K Camtasia master is kept outside the repository; re-encoding is two ffmpeg
334+
commands recorded in `docs/teaser/shot-script.md`. Autoplay means every home-page visit
335+
downloads a rendition (about 3 MB), so GitHub Pages' ~100 GB/month soft bandwidth limit
336+
maps to roughly 30,000 visits a month — far beyond this site's traffic, and GitHub has
337+
no bandwidth meter to watch anyway. If a launch ever approaches that, the escape hatch
338+
is a lighter loop rendition or a caching proxy in front of the domain, not an embed.
331339

332340
---
333341

site/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ <h1>The whiteboard for <span class="accent">teaching</span></h1>
8181
<div class="teaser-frame">
8282
<!-- Served from this site: no third party, and it plays where embeds are
8383
blocked. Decision 19 in docs/decisions.md. -->
84-
<video controls playsinline preload="metadata"
84+
<video controls autoplay muted loop playsinline
8585
poster="teaser-poster.jpg"
8686
title="SQLBI Whiteboard, forty seconds">
8787
<source src="teaser-av1.mp4" type='video/mp4; codecs="av01.0.12M.08"'>
@@ -308,5 +308,17 @@ <h2>Read next</h2>
308308
});
309309
})();
310310
</script>
311+
<script>
312+
// The teaser loop is motion the visitor did not ask for. Stop it for those
313+
// who asked their system for less; the poster and controls remain.
314+
(function () {
315+
if (!window.matchMedia || !matchMedia('(prefers-reduced-motion: reduce)').matches) { return; }
316+
var teaser = document.querySelector('.teaser video');
317+
if (teaser) {
318+
teaser.removeAttribute('autoplay');
319+
teaser.pause();
320+
}
321+
})();
322+
</script>
311323
</body>
312324
</html>

0 commit comments

Comments
 (0)