简体   繁体   English

将Flash插件与内联ckeditor一起使用

[英]Using flash plugin with inline ckeditor

I am using inline ckeditor version 4.0.2 and trying to embed a flash object(ooyala video) using the flash plugin. 我正在使用内联ckeditor版本4.0.2,并尝试使用Flash插件嵌入Flash对象(ooyala视频)。 After adding the url I see a image "Flash" instead of the video. 添加网址后,我看到的是图像“ Flash”而不是视频。 Also, after saving the code I still see the same image instead of the video. 另外,保存代码后,我仍然看到相同的图像而不是视频。

here is the code of that flash image 这是该Flash图片的代码

<img class="cke_flash" data-cke-realelement="the real element code" data-cke-real-node-type="1" alt="Flash Animation" title="Flash Animation" align="absMiddle" src="http://localhost:3000/javascripts/lib/ckeditor_4.0.2/plugins/fakeobjects/images/spacer.gif?t=D26D" data-cke-real-element-type="flash" data-cke-resizable="true">

How can i see the actual video instead of this image? 如何查看实际视频而不是该图像?

You cannot see the flash video in the editor on purpose. 您无法故意在编辑器中看到Flash视频。 It is replaced by dummy image to secure editor's contents and to make sure that clicking (or other interaction) with embedded object doesn't break the editor. 它被替换为虚拟图像,以保护编辑器的内容并确保与嵌入式对象的单击(或其他交互)不会破坏编辑器。 Flash can go fullscreen, load lots of data, make noise or anything else that, generally speaking, is undesired while working in the editor. Flash可以全屏显示,加载大量数据,产生噪音或其他在编辑器中工作时通常不希望出现的其他现象。

Once you get data from the editor, your flash is converted to desired markup, ie: 从编辑器获取数据后,您的Flash便转换为所需的标记,即:

<p>
   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
      <param name="quality" value="high" />
      <param name="movie" value="someFlashToBeLoaded.swf" />
      <embed pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="qwe.swf" type="application/x-shockwave-flash"></embed>
   </object>
</p>

Just make sure that you get editor's data with CKEDITOR.instances.yourInstance.getData() . 只需确保使用CKEDITOR.instances.yourInstance.getData()获得编辑器的数据即可。 Never directly with element.innerHTML , $('ckeditor').html() or similar. 绝对不要直接使用element.innerHTML$('ckeditor').html()或类似名称。

What you have in editor's DOM is not what you get with editor.getData() . 编辑器DOM 中没有的东西与editor.getData() This is because because editor performs advanced processing, filtering and stuff to return a valid HTML, including your flash embedding markup. 这是因为编辑器执行高级处理,过滤和填充以返回有效的HTML,包括您的Flash嵌入标记。

See more in docs . docs中查看更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM