If you are simply trying to embed a youtube video into the document, you
could insert an iframe object instead. See the following link for an
example:
http://groups.google.com/group/cleditor/browse_thread/thread/15b3747b25fc3f7
/886dc0de0ff0c407?lnk=gst&q=youtube#886dc0de0ff0c407
Your html would look something like this:
<iframe class="youtube-player" type="text/html" width="480"
height="385" src="http://www.youtube.com/embed/5-XEa2zVjAg"
frameborder="0"></iframe>
If you absolutely must use an object tag, you could insert an object element
directly into the iframe DOM at the location pointed to by the current range
object within the document.
Hope this helps,
Chris
After some additional testing, I believe that I have found the problem. It appears that in Firefox version 3.6.10, a change was made to the browsers execCommand method which prevents the inserthtml command from inserting both object and iframe tags. All other tags that I tested appear to work just fine. I also tested several older versions of Firefox and they do not exhibit this problem. If you look at the link I posted in my previous reply, you will see that this was working fine on September 26th. Since then, I had upgraded to 3.6.10 and now it will not work.
As a work around, you could get the range object of the document within the iframe to determine the parent node and offset, then manually create the element from the html string and insert it into the DOM. This should work on all W3C compliant browsers and IE could continue to use the inserthtml command.
After I release the next version, I was thinking about adding a custom youtube plugin, but that might be a ways off.
Hope this helps,
Chris