1
votes

In TinyMCE, I've successfully built a link list

plugins: link,
link_list: [
{title:'video title', value: 'url'},
{tile: 'video title', value: 'url'}
],

But I need something more for a youtube video link list that automatically embeds them in iframes with 100% width and height.

I have users who are not quite tech savy enough to get the youtube embed code, put it in the editor media embed field and change the height and width.

I was hoping I could give them a list of all youtube videos from our channel that automatically put it in an iframe with 100% height and width.

Any ideas?

2

2 Answers

2
votes

You can certainly do what you want but you likely want to build your own custom functionality to do this as the built in capabilities are not designed to do what you need.

You could just place a toolbar button on the toolbar and invoke JavaScript to open a "dialog" of your creation or you could put all of this in a custom plugin so its bundled up neatly in one place.

Either will work just fine.

The insertContent (https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#insertcontent) API is the one you need to inject the HTML back into the editor when the user picks the video to insert.

1
votes

If you don't want to write your own plugin to do that, the solution is this plugin that will create the embed iframe for you inside the content created from the user who use the TinyMCE editor enhanced media embed plugin . I didn't tested it, but I think it will be fit all your needs