diff --git a/src/shared/components/post/metadata-card.tsx b/src/shared/components/post/metadata-card.tsx
index 2d770d44..a1ddca7f 100644
--- a/src/shared/components/post/metadata-card.tsx
+++ b/src/shared/components/post/metadata-card.tsx
@@ -1,8 +1,7 @@
-import { Component, linkEvent } from "inferno";
+import { Component } from "inferno";
import { Post } from "lemmy-js-client";
import * as sanitizeHtml from "sanitize-html";
import { relTags } from "../../config";
-import { I18NextService } from "../../services";
import { Icon } from "../common/icon";
interface MetadataCardProps {
@@ -17,10 +16,6 @@ export class MetadataCard extends Component<
MetadataCardProps,
MetadataCardState
> {
- state: MetadataCardState = {
- expanded: false,
- };
-
constructor(props: any, context: any) {
super(props, context);
}
@@ -29,7 +24,7 @@ export class MetadataCard extends Component<
const post = this.props.post;
return (
<>
- {!this.state.expanded && post.embed_title && post.url && (
+ {post.embed_title && post.url && (
@@ -61,34 +56,12 @@ export class MetadataCard extends Component<
}}
/>
)}
- {post.embed_video_url && (
-
- )}
)}
- {this.state.expanded && post.embed_video_url && (
-
-
-
- )}
>
);
}
-
- handleIframeExpand(i: MetadataCard) {
- i.setState({ expanded: !i.state.expanded });
- }
}
diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx
index e5694fa7..092e253e 100644
--- a/src/shared/components/post/post-listing.tsx
+++ b/src/shared/components/post/post-listing.tsx
@@ -262,6 +262,7 @@ export class PostListing extends Component {
const { post } = this.postView;
const { url } = post;
+ // if direct video link
if (url && isVideo(url)) {
return (
@@ -272,6 +273,20 @@ export class PostListing extends Component
{
);
}
+ // if embedded video link
+ if (url && post.embed_video_url) {
+ return (
+
+
+
+ );
+ }
+
return <>>;
}
@@ -338,7 +353,7 @@ export class PostListing extends Component {
);
} else if (url) {
- if (!this.props.hideImage && isVideo(url)) {
+ if ((!this.props.hideImage && isVideo(url)) || post.embed_video_url) {
return (