Should be OR

A short video can be treated as GIF.
Loopability is only for <= 60 second video
This commit is contained in:
Lim Chee Aun 2022-12-24 10:23:06 +08:00
parent b96f263f69
commit 71514312bf

View file

@ -732,7 +732,9 @@ function Media({ media, showOriginal, onClick = () => {} }) {
); );
} else if (type === 'gifv' || type === 'video') { } else if (type === 'gifv' || type === 'video') {
// 20 seconds, treat as a gif // 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 ( return (
<div <div
class={`media media-${isGIF ? 'gif' : 'video'}`} class={`media media-${isGIF ? 'gif' : 'video'}`}
@ -774,7 +776,7 @@ function Media({ media, showOriginal, onClick = () => {} }) {
muted={isGIF} muted={isGIF}
controls={!isGIF} controls={!isGIF}
playsinline playsinline
loop loop={loopable}
onClick={() => { onClick={() => {
if (isGIF) { if (isGIF) {
try { try {