Handle case when previewUrl is a video instead of thumbnail image

pull/1064/head^2
Lim Chee Aun 2025-04-16 08:41:15 +08:00
rodzic c1498974cd
commit 97384b517f
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -185,6 +185,8 @@ function Media({
const isImage =
type === 'image' ||
(type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);
const isPreviewVideoMaybe = previewUrl &&
/\.(mp4|m4r|m4v|mov|webm)$/i.test(getURLObj(previewUrl).pathname);
const parentRef = useRef();
const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);
@ -577,7 +579,7 @@ function Media({
/>
) : (
<>
{previewUrl ? (
{previewUrl && !isPreviewVideoMaybe ? (
<img
src={previewUrl}
alt={showInlineDesc ? '' : description}

2
src/locales/en.po wygenerowano
Wyświetl plik

@ -1314,7 +1314,7 @@ msgstr ""
msgid "Filtered"
msgstr ""
#: src/components/media.jsx:414
#: src/components/media.jsx:416
msgid "Open file"
msgstr "Open file"