Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding YouTube video with new iframe embed code in TinyMCE

I tried the old embed code for adding YouTube videos into TinyMCE and it works fine. Some of the users may not realise they have to click on the old embed code option in YouTube embed code link to add it in.

I want to make it easy for users and allow them to just copy the new embed code directly and paste it on TinyMCE and away they go.

The new embed code looks like the following example:

<iframe title="YouTube video player" width="640" height="390" 
        src="http://www.youtube.com/embed/VvJ037b_kLs" 
        frameborder="0" allowfullscreen></iframe> 

How do I get TinyMCE to accept the new version of the YouTube embed code with iframe?

I'm working on a CakePHP site build.

like image 304
George Leow Avatar asked Feb 14 '11 05:02

George Leow


People also ask

How do I embed a YouTube video in Visual Studio code?

Click the "Share" link under your YouTube video to expose the available sharing options. Click the "Embed" button and you will see a box just below it fill with code.

Where can I embed my YouTube videos?

Go to the YouTube page, select a video, and click on the 'Share' option that is displayed below. Here you'll find the; 'Embed' option, click on that option. Now you'll get the Embed Code; you can copy the code from here.


1 Answers

I think that the use of "extended_valid_elements" is better than edit the original settings.

See that: TinyMCS - extended_valid_elements

like image 100
jhernandis Avatar answered Oct 23 '22 19:10

jhernandis