Fix auto download bug (#2552)

This commit is contained in:
SleeplessOne1917 2024-06-17 23:50:17 +00:00 committed by GitHub
parent 1ee1bdeaa9
commit 4293c5a6c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 18 deletions

View file

@ -145,7 +145,7 @@
"sortpack" "sortpack"
] ]
}, },
"packageManager": "pnpm@9.4.0", "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
"engineStrict": true, "engineStrict": true,
"importSort": { "importSort": {
".js, .jsx, .ts, .tsx": { ".js, .jsx, .ts, .tsx": {

View file

@ -225,8 +225,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
return <></>; return <></>;
} }
// if direct video link // if direct video link or embedded video link
if (url && isVideo(url)) { if (url && (isVideo(url) || post.embed_video_url)) {
return ( return (
<div className="embed-responsive ratio ratio-16x9 mt-3"> <div className="embed-responsive ratio ratio-16x9 mt-3">
<video <video
@ -236,26 +236,12 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
controls controls
className="embed-responsive-item col-12" className="embed-responsive-item col-12"
> >
<source src={url} type="video/mp4" /> <source src={post.embed_video_url ?? url} type="video/mp4" />
</video> </video>
</div> </div>
); );
} }
// if embedded video link
if (url && post.embed_video_url) {
return (
<div className="ratio ratio-16x9">
<iframe
allowFullScreen
className="post-metadata-iframe"
src={post.embed_video_url}
title={post.embed_title}
></iframe>
</div>
);
}
if (this.imageSrc) { if (this.imageSrc) {
return ( return (
<> <>