mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 09:06:23 +01:00
Maybe some videos are short
This commit is contained in:
parent
ca18ea138a
commit
6d893967ec
1 changed files with 3 additions and 2 deletions
|
@ -756,7 +756,8 @@ function Media({ media, showOriginal, autoAnimate, 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 shortDuration = original.duration <= 20;
|
const shortDuration = original.duration <= 20;
|
||||||
const isGIF = type === 'gifv' || shortDuration;
|
const isGIFV = type === 'gifv';
|
||||||
|
const isGIF = isGIFV || shortDuration;
|
||||||
const loopable = original.duration <= 60;
|
const loopable = original.duration <= 60;
|
||||||
const formattedDuration = formatDuration(original.duration);
|
const formattedDuration = formatDuration(original.duration);
|
||||||
const hoverAnimate = !showOriginal && !autoAnimate && isGIF;
|
const hoverAnimate = !showOriginal && !autoAnimate && isGIF;
|
||||||
|
@ -810,7 +811,7 @@ function Media({ media, showOriginal, autoAnimate, onClick = () => {} }) {
|
||||||
preload="auto"
|
preload="auto"
|
||||||
autoplay
|
autoplay
|
||||||
muted="${isGIF}"
|
muted="${isGIF}"
|
||||||
${isGIF ? '' : 'controls'}
|
${isGIFV ? '' : 'controls'}
|
||||||
playsinline
|
playsinline
|
||||||
loop="${loopable}"
|
loop="${loopable}"
|
||||||
></video>
|
></video>
|
||||||
|
|
Loading…
Reference in a new issue