From 71514312bf1f54ca54ab04e78ff22d1eecc744c3 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 24 Dec 2022 10:23:06 +0800 Subject: [PATCH] Should be OR A short video can be treated as GIF. Loopability is only for <= 60 second video --- src/components/status.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 269afb9b..fac902d9 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -732,7 +732,9 @@ function Media({ media, showOriginal, onClick = () => {} }) { ); } else if (type === 'gifv' || type === 'video') { // 20 seconds, treat as a gif - const isGIF = type === 'gifv' && original.duration <= 20; + const shortDuration = original.duration <= 20; + const isGIF = type === 'gifv' || shortDuration; + const loopable = original.duration <= 60; return (
{} }) { muted={isGIF} controls={!isGIF} playsinline - loop + loop={loopable} onClick={() => { if (isGIF) { try {