fix(booth): lazy-load gallery media — preload=none on video/audio

A booth of a dozen webms fetched them all at page load
(preload=metadata still pulls real byte ranges per file); nothing
loads now until the viewer hits play.
This commit is contained in:
vh
2026-08-14 23:18:47 -07:00
parent 6872e524de
commit 36a79ff453
+5 -2
View File
@@ -29,9 +29,12 @@
{% if it.kind == 'image' %}
<a href="view?f={{ it.url }}"><img loading="lazy" src="{{ it.url }}" alt="{{ it.name }}"></a>
{% elif it.kind == 'video' %}
<video controls preload="metadata" src="{{ it.url }}"></video>
{# preload="none": a booth of a dozen webms was fetching them
all at page load ("metadata" still pulls real ranges per
file); nothing loads until the viewer hits play #}
<video controls preload="none" src="{{ it.url }}"></video>
{% elif it.kind == 'audio' %}
<audio controls preload="metadata" src="{{ it.url }}"></audio>
<audio controls preload="none" src="{{ it.url }}"></audio>
{% elif it.doc %}
<a class="dl doc" href="view?f={{ it.url }}" title="view {{ it.name }}">📄 {{ it.name }}</a>
{% else %}