tinymce icon indicating copy to clipboard operation
tinymce copied to clipboard

video_template_callback is not being triggered

Open YovavGad opened this issue 9 years ago • 4 comments

video_template_callback is not being triggered as suggested in the documentation : https://www.tinymce.com/docs/plugins/media/#video_template_callback

tinymce version 4.5.2

YovavGad avatar Feb 07 '17 13:02 YovavGad

Same bug with the 4.5.5 version. It works if you write an invalid URL, go to embed tab, go back to the general tab and write the good url.

johnrazeur avatar Mar 12 '17 15:03 johnrazeur

I spent some time trying to add onclick and controlslist props to my video tag. Initially, it didn't appear, but after some time of research I figured out that TinyMCE has a whitelist of tag properties and I need to add it to the extended_valid_elements. It works with this configuration:

extended_valid_elements: 'video[onclick|controlslist|controls]',
video_template_callback: ({
  width, height, poster, source1, source1mime, source2, source2mime,
}) => [
    `<video onclick="this.play()" controls controlslist="nodownload" width="${width}" height="${height}" ${(poster ? `poster="${poster}` : '')}>`,
    `<source src="${source1}" ${(source1mime ? `type="${source1mime}"` : '')} />`,
    `<source src="${source2}" ${(source2mime ? `type="${source2mime}"` : '')} />`,
    '</video>',
].join(''),

Also, please note that all properties should be lowercased.

jokezer avatar Dec 07 '17 13:12 jokezer

By looking at the code, it seems that video_template_callback is only called as a last resort, when it can't guess the correct template for the video.

The documentation doesn't mention this behavior at all. Or at least, from reading it, I'd expect video_template_callback to always be called, not matter what kind of video I've selected.

pdfrod avatar Jan 15 '18 10:01 pdfrod

This issue has been closed due to inactivity. Tiny will soon be working with members of the community to close other old issues on our GitHub repositories. There are some excellent discussions and reports in the main TinyMCE GitHub repository, but with so many open issues, we cannot monitor them all. Reviewing all of the issues individually would be an enormous task, requiring time that could be better spent developing new features and fixing bugs. Therefore, we are closing issues that have been inactive for over 365 days, with some exceptions. If this issue is still relevant, please re-open this issue or create a new one. If you have any questions or concerns, you can contact me at [email protected]. You can also join the discussion on our mailing list at the following link: [email protected].

thedrjim avatar Oct 30 '20 05:10 thedrjim