【问题标题】:ckeditor plugins html5 video and audio not possible together?ckeditor 插件 html5 视频和音频不能一起使用?
【发布时间】:2017-11-17 10:35:10
【问题描述】:

我在向 CKEditor 添加插件时遇到了一个奇怪的问题:

第 1 步: 我添加了插件 html5audio。配置文件:

... 
config.extraPlugins = 'html5audio';
config.toolbar = [ ['Html5audio'] ];
...

这非常有效。没有错误。

第 2 步: 然后我添加了插件 html5video。配置文件:

... 
config.extraPlugins = 'html5audio';
config.extraPlugins = 'html5video';
config.toolbar = [ ['Html5audio'],['Html5video'] ];
...

html5audio 不加载并且按钮消失。仅加载视频。工具栏中的音频按钮消失。 CKEditor 在浏览器 console.log 上没有显示错误。

如果我将序列交换为:

config.extraPlugins = 'html5video';
config.extraPlugins = 'html5audio';

然后音频加载,视频消失。

似乎这些插件互相踢出,队列中的最后一个获胜。

我正在使用 CKeditor 4.7.3。

感谢任何帮助和提示。

【问题讨论】:

    标签: ckeditor html5-video html5-audio ckeditor4.x


    【解决方案1】:

    您应该只使用一次 config.extraPlugins,否则您将覆盖声明。如果您要添加多个额外的插件,则 extraPlugins 选项需要一个逗号分隔的插件列表。在您的情况下,它应该是:

    config.extraPlugins = 'html5video,html5audio';
    

    CKEditor 的文档:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-10
      • 1970-01-01
      • 2023-03-03
      相关资源
      最近更新 更多