MediaAttachmentGrid: fix the element not updated
All checks were successful
/ depoly (push) Successful in 1m19s
All checks were successful
/ depoly (push) Successful in 1m19s
This problem causes "not supported codec"
This commit is contained in:
parent
f965bb4002
commit
acde7609ba
1 changed files with 12 additions and 0 deletions
|
@ -152,6 +152,7 @@ const MediaAttachmentGrid: Component<{
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
|
data-media-type={item().type}
|
||||||
src={item().previewUrl}
|
src={item().previewUrl}
|
||||||
width={item().meta?.small?.width}
|
width={item().meta?.small?.width}
|
||||||
height={item().meta?.small?.height}
|
height={item().meta?.small?.height}
|
||||||
|
@ -165,6 +166,7 @@ const MediaAttachmentGrid: Component<{
|
||||||
return (
|
return (
|
||||||
<video
|
<video
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
|
data-media-type={item().type}
|
||||||
src={item().url || undefined}
|
src={item().url || undefined}
|
||||||
autoplay={settings().autoPlayVideos}
|
autoplay={settings().autoPlayVideos}
|
||||||
playsinline={settings().autoPlayVideos ? true : undefined}
|
playsinline={settings().autoPlayVideos ? true : undefined}
|
||||||
|
@ -178,6 +180,8 @@ const MediaAttachmentGrid: Component<{
|
||||||
case "gifv":
|
case "gifv":
|
||||||
return (
|
return (
|
||||||
<video
|
<video
|
||||||
|
data-sort={index}
|
||||||
|
data-media-type={item().type}
|
||||||
src={item().url || undefined}
|
src={item().url || undefined}
|
||||||
autoplay={settings().autoPlayGIFs}
|
autoplay={settings().autoPlayGIFs}
|
||||||
controls
|
controls
|
||||||
|
@ -191,6 +195,14 @@ const MediaAttachmentGrid: Component<{
|
||||||
);
|
);
|
||||||
|
|
||||||
case "audio":
|
case "audio":
|
||||||
|
return (
|
||||||
|
<audio
|
||||||
|
data-sort={index}
|
||||||
|
data-media-type={item().type}
|
||||||
|
src={item().url || undefined}
|
||||||
|
controls
|
||||||
|
></audio>
|
||||||
|
);
|
||||||
case "unknown":
|
case "unknown":
|
||||||
return <div></div>;
|
return <div></div>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue