mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-18 08:12:01 +03:00
Should be OR
A short video can be treated as GIF. Loopability is only for <= 60 second video
This commit is contained in:
parent
b96f263f69
commit
71514312bf
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue