fix(post): video thumbnails were not showing on mobile, without preload

This commit is contained in:
plebeius.eth
2024-03-22 17:34:32 +01:00
parent 3dc5940824
commit 51cceae2d8
2 changed files with 2 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ const Expando = ({ authorEditReason, commentMediaInfo, content, expanded, link,
if (commentMediaInfo?.type === 'image') {
mediaComponent = <img src={commentMediaInfo.url} alt='' />;
} else if (commentMediaInfo?.type === 'video' && expanded) {
mediaComponent = <video src={commentMediaInfo.url} controls />;
mediaComponent = <video src={`${commentMediaInfo.url}#t=0.001`} controls />;
} else if (commentMediaInfo?.type === 'webpage' && commentMediaInfo?.thumbnail) {
mediaComponent = <img src={commentMediaInfo.thumbnail} alt='' />;
} else if (commentMediaInfo?.type === 'audio' && expanded) {

View File

@@ -38,7 +38,7 @@ const Thumbnail = ({ cid, commentMediaInfo, expanded = false, isReply = false, l
if (commentMediaInfo?.type === 'image') {
mediaComponent = <img src={commentMediaInfo.url} alt='' />;
} else if (commentMediaInfo?.type === 'video') {
mediaComponent = commentMediaInfo.thumbnail ? <img src={commentMediaInfo.thumbnail} alt='' /> : <video src={commentMediaInfo.url} />;
mediaComponent = commentMediaInfo.thumbnail ? <img src={commentMediaInfo.thumbnail} alt='' /> : <video src={`${commentMediaInfo.url}#t=0.001`} />;
} else if (commentMediaInfo?.type === 'webpage') {
mediaComponent = <img src={commentMediaInfo.thumbnail} alt='' />;
} else if (commentMediaInfo?.type === 'iframe') {