Fix Tiptap video node insertion for media library videos

This commit is contained in:
Carlos (Almeira) 2026-07-01 19:13:07 -05:00
parent c90e842cad
commit b79043ba1a

View File

@ -76,7 +76,7 @@ const MenuBar = ({ editor }: { editor: any }) => {
const handleMediaInsert = (fileId: string, url?: string, tipo?: string) => {
if (url) {
if (tipo === 'video') {
editor.chain().focus().insertContent({ type: 'videoNode', attrs: { src: url } }).run();
editor.chain().focus().insertContent(`<video src="${url}" controls="true" preload="metadata" class="w-full aspect-video rounded-xl shadow-lg my-6"></video>`).run();
} else {
editor.chain().focus().setImage({ src: url }).run();
}