kopia lustrzana https://github.com/cheeaun/phanpy
Handle case when previewUrl is a video instead of thumbnail image
rodzic
c1498974cd
commit
97384b517f
|
@ -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}
|
||||
|
|
|
@ -1314,7 +1314,7 @@ msgstr ""
|
|||
msgid "Filtered"
|
||||
msgstr ""
|
||||
|
||||
#: src/components/media.jsx:414
|
||||
#: src/components/media.jsx:416
|
||||
msgid "Open file"
|
||||
msgstr "Open file"
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue