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:
@@ -29,9 +29,12 @@
|
|||||||
{% if it.kind == 'image' %}
|
{% if it.kind == 'image' %}
|
||||||
<a href="view?f={{ it.url }}"><img loading="lazy" src="{{ it.url }}" alt="{{ it.name }}"></a>
|
<a href="view?f={{ it.url }}"><img loading="lazy" src="{{ it.url }}" alt="{{ it.name }}"></a>
|
||||||
{% elif it.kind == 'video' %}
|
{% 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' %}
|
{% elif it.kind == 'audio' %}
|
||||||
<audio controls preload="metadata" src="{{ it.url }}"></audio>
|
<audio controls preload="none" src="{{ it.url }}"></audio>
|
||||||
{% elif it.doc %}
|
{% elif it.doc %}
|
||||||
<a class="dl doc" href="view?f={{ it.url }}" title="view {{ it.name }}">📄 {{ it.name }}</a>
|
<a class="dl doc" href="view?f={{ it.url }}" title="view {{ it.name }}">📄 {{ it.name }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user