Page 1 of 1

Can't embed code in post

Posted: Thu Jun 27, 2013 9:28 pm
by lstench
Hello I am using the new editor (ckeditor) and I am unable to embed any youtube videos or anything in my html nugget plugin on my sidebar. Is there a way I can fix this problem?

Re: Can't embed code in post

Posted: Fri Jun 28, 2013 5:57 am
by Don Chambers
Please post a url to your site, as well as a link to the code that is not working.

Re: Can't embed code in post

Posted: Fri Jun 28, 2013 10:24 pm
by lstench
Here is the info you requsested.

http://lydiastench.com/

This is the link to the actual post.

http://lydiastench.com/archives/37-Maundy-Thursday.html

It is now showing up.It wouldn't display all yesterday. When I went just now it was there. Nothing is showing in the editor though. Attached screenshot.

The link to the video.
http://www.youtube.com/watch?feature=pl ... 6s22GxaCQ0

Re: Can't embed code in post

Posted: Sat Jun 29, 2013 12:00 am
by Don Chambers
Yes, the video works fine. When you add code like that to an entry, it is usually best to add it when in html mode. I have not used ckeditor, but there is probably a button that changes modes from wysiwyg mode, to html/code mode.

Re: Can't embed code in post

Posted: Sat Jun 29, 2013 1:01 am
by lstench
I did use the source mode. It lets me add it but as soon as I push save it disappears and doesn't show up for hours on my blog and never shows up in the editor.

Re: Can't embed code in post

Posted: Sat Jun 29, 2013 10:31 am
by Timbalu
So how did you get it to appear working fine in your entry, then?
What is the code you pasted into the editor?

. . .
I just did a quick test.
It appears to be like this: Insert as source code

Code: Select all

<iframe width="560" height="315" src="//www.youtube.com/embed/C6s22GxaCQ0" frameborder="0" allowfullscreen></iframe>
If I preview this entry, the preview looks fine, but the entry textarea shows nothing. And if furthermore saved, the fontend entry does not display the video.

If you put in the video and save the entry, all is well in the frontend. If you re-open this entry, the pasted iframe-code is gone and you would need to re-add it again before saving.

Solution: If using preview, or re-writing an entry please re-paste the video again, before saving.

I cannot tell you which funny bug or setting does make this happen like this, but it is some sort of iframe issue. Possibly in the CKEDITOR Javascript build.

We have to wait until they recognize this issue and solve it in a new version, I assume.
Or you could link yourself to the ckeditor forum and ask for help (and tell us afterwards!). :wink:

. . .
EDIT 2:
I found the issue, its incredible easy to solve. :D
CKEDITOR uses Advanced Content Filtering (ACF), which denies things like this.
Solution: Go to your backend → Manage Plugins → Event section → Ckeditor Plugin Configuration and set ACF turn off to true (YES).

In the ckeditor forum they say, the ckeditor plugin for embedding videos isn't fully working yet and the upper temporary ACF off solution isn't
... exactly the solution -- this setting will turn ACF off for anyone who's using it. The proper way to fix the issue is to update the plugin to comply with Advanced Content Filter and *not* to turn the filter off. for the whole editor.
You could also install the ckeditor plugin MediaEmbed from here https://github.com/frozeman/MediaEmbed since this has now solved the ACF issue by allowing iframe with media integraton.

This plugin is not part of the standard ckeditor package, since this has ACF and - if turned off - will also allow iframed videos. So in short, it is a decision of secureness.

Re: Can't embed code in post

Posted: Sat Jun 29, 2013 4:52 pm
by lstench
Thank you!! I was starting to think I was imagining things. I will edit the plugin. Is the MediaEmbed plugin safe to use?

Re: Can't embed code in post

Posted: Sat Jun 29, 2013 5:01 pm
by Timbalu
I never have used it, but having a look into the source it does not do anything unwanted, I presume. It opens a new dialog box per new toolbar icon to put the video iframe in.
https://github.com/frozeman/MediaEmbed/ ... /plugin.js

If that is something you are not sure about, just turn off ACF and your video is shown.