fix: keep GIFs moving in reply contexts (v2.20.1)

Mastodon turns GIFs into silent looping MP4s (gifv); only the first-frame
preview was kept. The MP4 is now saved locally and played muted and
looping with the still as poster. Animated GIFs from other sites are saved
as animated WebP. Migration 025 adds reply_contexts.video and has
fediverse contexts with an image fetched again once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-13 20:28:20 -07:00
1 parent 03a1c8fcea
commit 952ca300c0
9 files changed
+193 -19

No files matched your search

+5 -1
View File
@@ -34,7 +34,11 @@
{% if ctx.title %}<p class="p-name reply-title">{{ ctx.title }}</p>{% endif %}
{% if ctx.content_snippet %}<div class="e-content reply-content">{{ ctx.content_snippet|safe }}</div>{% endif %}
{% set image = ctx.photo|local_preview %}
{% if image %}<img class="reply-photo" src="{{ image }}" alt="{{ ctx.photo_alt or '' }}" loading="lazy">{% endif %}
{% set video = ctx.video|local_video if ctx.video is defined else None %}
{% if video %}
{# Mastodon "GIFs" are silent looping MP4s: shown as Mastodon shows them (v2.20.1) #}
<video class="reply-photo" src="{{ video }}"{% if image %} poster="{{ image }}"{% endif %} autoplay loop muted playsinline{% if ctx.photo_alt %} aria-label="{{ ctx.photo_alt }}" title="{{ ctx.photo_alt }}"{% endif %}></video>
{% elif image %}<img class="reply-photo" src="{{ image }}" alt="{{ ctx.photo_alt or '' }}" loading="lazy">{% endif %}
<footer class="reply-source">
<a class="u-url" href="{{ url }}">{{ _when(ctx, '%B %-d, %Y · %-I:%M %p') }}{% if ctx.published_at and ctx.published_at.strftime is defined %} · {% endif %}{{ ctx.site_name or url.split('/')[2] }} ↗</a>
</footer>