From cfc834c600568e99047ce9b7ec78b0447b9bafae Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Fri, 5 Dec 2025 11:11:05 +0545 Subject: [PATCH] fix(OUT-2711): cannot change the size, cannot go fulscreen mode on video embeds. - used allowFullScreen attributes on the iframe embed. - used link-to-iframe package to convert urls to support embedding. --- package.json | 1 + src/components/tiptap/iframe/EmbedComponent.tsx | 7 ++++++- yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c374d11..79c1206 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "copilot-node-sdk": "^3.12.1", "handlebars": "^4.7.8", "http-status": "^1.7.4", + "link-to-iframe": "^1.0.8", "next": "latest", "p-retry": "^6.2.1", "prisma": "^5.6.0", diff --git a/src/components/tiptap/iframe/EmbedComponent.tsx b/src/components/tiptap/iframe/EmbedComponent.tsx index b2af5c1..2ca10f5 100644 --- a/src/components/tiptap/iframe/EmbedComponent.tsx +++ b/src/components/tiptap/iframe/EmbedComponent.tsx @@ -4,6 +4,7 @@ import { Resize } from '../image/resizeIcon' import { useAppState } from '@/hooks/useAppState' import { usePathname } from 'next/navigation' import { debounce } from '@mui/material' +import { IframeAttributes, linkToIframe } from 'link-to-iframe' export const EmbedComponent = (props: any) => { const [isResizing, setIsResizing] = useState(false) @@ -52,6 +53,9 @@ export const EmbedComponent = (props: any) => { const appState = useAppState() const pathname = usePathname() + const video = linkToIframe(extractIframeSrc(props.node.attrs.src), { + returnObject: true, + }) as IframeAttributes //safe to do. returnObject: true always returns an IframeAttributes object. return ( @@ -63,13 +67,14 @@ export const EmbedComponent = (props: any) => { }} >