From c04240c44479c8b664ed0d01fa794241e9936e3d Mon Sep 17 00:00:00 2001 From: Ahtesham Quraish Date: Mon, 23 Feb 2026 14:49:58 +0500 Subject: [PATCH 1/6] fix: add support for mp4 videos --- .../ProductPages/ProductPageTemplate.tsx | 1 - .../node/MediaEmbed/MediaEmbedNodeView.tsx | 27 +++++++++++++------ .../node/MediaEmbed/MediaEmbedViewer.tsx | 19 ++++++++++++- .../extensions/node/MediaEmbed/lib.ts | 17 ++++++++++++ 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/frontends/main/src/app-pages/ProductPages/ProductPageTemplate.tsx b/frontends/main/src/app-pages/ProductPages/ProductPageTemplate.tsx index 7b7e89396f..6e3c7647d3 100644 --- a/frontends/main/src/app-pages/ProductPages/ProductPageTemplate.tsx +++ b/frontends/main/src/app-pages/ProductPages/ProductPageTemplate.tsx @@ -91,7 +91,6 @@ const MainCol = styled.div({ minWidth: 0, display: "flex", flexDirection: "column", - minWidth: 0, }) const SectionsWrapper = styled.div(({ theme }) => ({ diff --git a/frontends/main/src/page-components/TiptapEditor/extensions/node/MediaEmbed/MediaEmbedNodeView.tsx b/frontends/main/src/page-components/TiptapEditor/extensions/node/MediaEmbed/MediaEmbedNodeView.tsx index 2ac8ff89d9..6d3e1a6f61 100644 --- a/frontends/main/src/page-components/TiptapEditor/extensions/node/MediaEmbed/MediaEmbedNodeView.tsx +++ b/frontends/main/src/page-components/TiptapEditor/extensions/node/MediaEmbed/MediaEmbedNodeView.tsx @@ -5,6 +5,7 @@ import { FullWidth, WideWidth, DefaultWidth } from "./Icons" import { RiCloseLargeLine } from "@remixicon/react" import { ActionButton } from "@mitodl/smoot-design" import { EditableCaption } from "../shared/EditableCaption" +import { isVideoUrl } from "./lib" const StyledNodeViewWrapper = styled(NodeViewWrapper, { shouldForwardProp: (prop) => @@ -123,7 +124,16 @@ const MediaContainer = styled.div(({ theme }) => ({ display: "block", }, - ".layout-full & iframe": { + video: { + width: "100%", + height: "100%", + borderRadius: "6px", + display: "block", + objectFit: "contain", + backgroundColor: "#000", + }, + + ".layout-full & iframe, .layout-full & video": { borderRadius: 0, }, ".ProseMirror-selectednode .layout-wide &": { @@ -216,13 +226,14 @@ export const MediaEmbedNodeView = ({ )} -