Add gifv support

https://hachyderm.io/@Impossible_PhD/111444541628207638
This commit is contained in:
blankie 2023-11-24 11:22:44 +11:00
parent 7fe118f303
commit c92b063581
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 7 additions and 0 deletions

View File

@ -427,6 +427,13 @@ static inline Element serialize_media(const Media& media) {
return video; return video;
} else if (media.type == "audio") { } else if (media.type == "audio") {
return Element("audio", {{"controls", ""}, {"src", media.url}}, {}); 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) { } else if (media.type == "unknown" && media.remote_url) {
if (media.remote_url) { if (media.remote_url) {
// https://botsin.space/@lina@vt.social/111053598696451525 // https://botsin.space/@lina@vt.social/111053598696451525