为Django ckeditor配置上传视频:https://www.byincd.com/bobjiang/article-01128/

使用

1. 手动下载插件

html5video的插件:https://github.com/bahriddin/ckeditor-html5-video
解压插件,将html5video放到site-packages的目录里
django-ckeditor配置html5video上传视频

2. 修改ckeditor源码

通过使用ckeditor-》config.js-》extraPlugins配置启用html5video插件

config.extraPlugins = 'html5video';

django-ckeditor配置html5video上传视频

2. 将html5video加到CKEDITOR_CONFIGS里

django-ckeditor配置html5video上传视频
django-ckeditor配置html5video上传视频

3. 让前台页面,video标签有播放控件

// video播放,没有指定 controls 属性,视频不会展示浏览器自带的控件
$('video').attr('controls', '');

django-ckeditor配置html5video上传视频

4. 压缩静态文件

python manage.py collectstatic --noinput
python manage.py compress --force

5. 测试

django-ckeditor配置html5video上传视频

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-08-24
  • 2022-01-13
  • 2021-08-15
猜你喜欢
  • 2021-05-06
  • 2021-09-10
  • 2021-06-20
  • 2021-05-28
  • 2021-10-31
相关资源
相似解决方案