From c92b063581c4173e6e062fd4daeba1e524db55bb Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 24 Nov 2023 11:22:44 +1100 Subject: [PATCH] Add gifv support https://hachyderm.io/@Impossible_PhD/111444541628207638 --- servehelper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servehelper.cpp b/servehelper.cpp index 66590c9..7ec0d79 100644 --- a/servehelper.cpp +++ b/servehelper.cpp @@ -427,6 +427,13 @@ static inline Element serialize_media(const Media& media) { return video; } else if (media.type == "audio") { return Element("audio", {{"controls", ""}, {"src", media.url}}, {}); + } else if (media.type == "gifv") { + // https://hachyderm.io/@Impossible_PhD/111444541628207638 + Element video("video", {{"controls", ""}, {"loop", ""}, {"muted", ""}, {"autoplay", ""}, {"src", media.url}}, {}); + if (media.preview_url) { + video.attributes.push_back({"poster", *media.preview_url}); + } + return video; } else if (media.type == "unknown" && media.remote_url) { if (media.remote_url) { // https://botsin.space/@lina@vt.social/111053598696451525