I’m trying to add video handler into my quill editor and it working. However, I want to add capability to prevent video download like <video>
tag did. Here’s my code
const videoHandler = () => {
if (quillRef.current) {
const editor = quillRef.current.getEditor();
if (editor) {
var range = editor.getSelection();
var value = prompt('Please paste the video URL here.');
if (value) {
if (value.includes('myService.com')) {
editor.insertEmbed(range.index, 'video', value, 'user');
} else {
alert('Only videos from myService.com domain are allowed.');
}
}
}
}
};
My attempt is tried to inser <video>
tag directly like this
const videoTag = <video width="100%" min-height="400px" controls controlsList="nodownload"> <source src="${value}" type="video/mp4"> </video> ;
const delta = editor.clipboard.convert({ html: videoTag });
It’s not working and I’m getting [Violation] 'click' handler took 521ms
warning.