From 7fb8981cbc02501ce54766d2bfe4c8440ecfee2a Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Sat, 5 Aug 2023 23:53:01 -0700 Subject: [PATCH] Add video preview support I really need to stop maintaining this and switch to Tooty full-time, but I haven't, so... --- public/style.css | 2 +- src/View/Status.elm | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/public/style.css b/public/style.css index 4edca6a..7c39356 100644 --- a/public/style.css +++ b/public/style.css @@ -487,7 +487,7 @@ form.search { cursor: zoom-in; } -.attachment-image img { +.attachment-image img, .attachment-image video { border-radius: 6px; width: 100%; } diff --git a/src/View/Status.elm b/src/View/Status.elm index 98c8b9c..871e8e2 100644 --- a/src/View/Status.elm +++ b/src/View/Status.elm @@ -58,6 +58,23 @@ attachmentPreview context sensitive attachments ({ url, preview_url } as attachm ] ] + "video" -> + a + [ if nsfw then + class "attachment-image nsfw" + else + class "attachment-image" + ] + [ video + [ controls True + , preload "auto" + , loop True + , controls True + ] + [ source [ src url ] [] + ] + ] + _ -> a [ if nsfw then