]> Untitled Git - lemmy-ui.git/commitdiff
Support new video embed api format (fixes #709) (#817)
authorNutomic <me@nutomic.com>
Tue, 4 Oct 2022 20:35:20 +0000 (20:35 +0000)
committerGitHub <noreply@github.com>
Tue, 4 Oct 2022 20:35:20 +0000 (16:35 -0400)
src/server/index.tsx
src/shared/components/post/metadata-card.tsx

index fbac4ee1ac72e67d92d70add2b08a5251ddf7612..d4a73a1babcaf9f41b640910be27447e21f9af81 100644 (file)
@@ -33,7 +33,7 @@ if (!process.env["LEMMY_UI_DISABLE_CSP"] && !process.env["LEMMY_UI_DEBUG"]) {
   server.use(function (_req, res, next) {
     res.setHeader(
       "Content-Security-Policy",
-      `default-src 'none'; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'`
+      `default-src 'none'; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'; frame-src *`
     );
     next();
   });
index 4dc68fdf0f5df4e590200495a7450b8c02db3f2a..128742b14fb200819cf892bfe5ad3a312a7283bd 100644 (file)
@@ -76,9 +76,8 @@ export class MetadataCard extends Component<
                             <button
                               className="mt-2 btn btn-secondary text-monospace"
                               onClick={linkEvent(this, this.handleIframeExpand)}
-                              data-tippy-content={i18n.t("expand_here")}
                             >
-                              {this.state.expanded ? "-" : "+"}
+                              {i18n.t("expand_here")}
                             </button>
                           )}
                         </div>
@@ -92,12 +91,7 @@ export class MetadataCard extends Component<
           })}
         {this.state.expanded &&
           post.embed_video_url.match({
-            some: html => (
-              <div
-                className="mt-3 mb-2"
-                dangerouslySetInnerHTML={{ __html: html }}
-              />
-            ),
+            some: video_url => <iframe src={video_url}></iframe>,
             none: <></>,
           })}
       </>