In tinymce, using the flash button, you can put http://www.youtube.com/watch?v=[ref code] into the text field and it will play the video. In fck, you cannot do this. But also, pasting the embed code directly into the fck text area simply results in the script being viewed as plain text - the video obviously doesn't play.

So how can users easily embed youtube video using fck?

Comments

wvd_vegt’s picture

Did you add embed to the input filter (like filtered html)? Otherwise the tag is removed from the output.

-Anti-’s picture

> Did you add embed to the input filter

Yes, embed was added for the flash button to work with uploaded swf files.

After further investigation, I found that whilst http://www.youtube.com/watch?v=[ref code]
doesn't work with the flash button, http://www.youtube.com/v/[ref code] does work.
This is at least something, but means that the user has to edit the url rather than simply copy/paste.

But I've still not found a good solution, except adding a 3rd party YT button to fck, which I don't really want to do due to having too many buttons already.

Another approach I might take is to put in a request to see if it is possible to have links to YT videos recognised by the 'jquery media' plugin, as I'm planning on using it for playing uploaded media anyway, and utilising YT would be a useful, popular feature.

I know about the cck approach, but I don't actually agree with that solution - IMO media should usually be in the body of content, not added with a special cck field.

I'm happy to hear any other ideas of how to add videos from YT and teacher tube using fckeditor.

wvd_vegt’s picture

Hi,

Just added one myself and got it working after adding two missing functions. (youtube-1.0.3.zip).

wwalc’s picture

A couple of options:
- use Youtube Plugin (disadvantage: another button)
- teach users to switch to source mode and paste embed code (remember to add object, param and embed tags to your input format)
- write a simple module that provides new filter using a hook_filter hook. You can make a simple regex search for http://www.youtube.com/watch?v=[0-9a-zA-Z] and replace it with valid HTML code necessary to display movie.
This way they could simply paste such link in FCKeditor without having to worry that they used the wrong button.

Jorrit’s picture

Status: Active » Closed (fixed)

Closed because of inactivity.

yusufvkr’s picture

Title: youtube url » http://www.youtube.com/v/u1zgFlCw8Aw?rel=1&color1=0x2b405b& color2=0x6b8ab6&border=1&fs=1
Version: 6.x-1.3-rc1 » 6.x-2.0-rc1
Category: support » bug