Fix Tiptap video node insertion for media library videos
This commit is contained in:
parent
c90e842cad
commit
b79043ba1a
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user