I believe the reason you are seeing a link instead of the actual youtube
video is because browsers only show links when in design mode. You might
want to try disabling the editor (using the .disable(true) method, as this
will turn off design mode and should actually load the video. If disabling
the editor allows you to preview the video, I could easily add a preview
toolbar button the would toggle between .disable(true) and .disable(false).
Once you have all the problems ironed out, perhaps you might like to share
this plugin with the rest of the community? I would be glad to put it up on
the web site.
Let me know if disabling the editor allows you to preview the video,
Chris
I spent a couple hours debugging this issue, which basically consisted of
switching into HTML mode, pasting in the YouTube <iframe> sample you
provided, and switching back into design mode. Firefox appears to be the
only browser that has a problem with the iframe content. IE, Chrome, Safari
and Opera work as expected.
After some additional debugging, I believe I have come up with a solution to
the problem. Within your plugin, just after you have run the
execCommand("inserthtml", ...) method to insert the YouTube iframe element,
add the following code:
// Check for firefox
if ($.browser.mozilla) {
// Recreate the iframe in a disabled state
editor.disabled = true;
editor.refresh();
// Wait for the YouTube iframe to finish loading
$(editor.$frame[0].contentWindow).load(function() {
// Enable the editor
editor.disable(false);
});
}
It appears that Firefox will not allow dynamic loading of content while it
is in designMode. The above code basically turns off designMode, loads the
content, then turns designMode back on.
Hope this helps,
Chris
-----Original Message-----
From: cled...@googlegroups.com [mailto:cled...@googlegroups.com] On Behalf
Of MasterChief
-----Original Message-----
From: cled...@googlegroups.com [mailto:cled...@googlegroups.com] On Behalf
Of MasterChief
Sent: Sunday, September 26, 2010 6:10 PM
To: cleditor
Subject: Re: Plugin for YouTube and another Streaming sites?
I would assume that the solution I presented would work with the object tag
as well, since it is simply waiting for the contents of CLEditors iframe to
finish loading and not the YouTube iframe. Let me know if this works.
Chris
-----Original Message-----
From: cled...@googlegroups.com [mailto:cled...@googlegroups.com] On Behalf
Of MasterChief
Sent: Tuesday, September 28, 2010 4:57 AM
To: cleditor
Subject: Re: Plugin for YouTube and another Streaming sites?