django-ckeditor配置html5video上传视频

参考信息

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

使用

1. 手动下载插件

html5video的插件:https://github.com/bahriddin/ckeditor-html5-video
解压插件,将html5video放到site-packages的目录里
image

2. 修改ckeditor源码

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

config.extraPlugins = 'html5video';

image

2. 将html5video加到CKEDITOR_CONFIGS里

image
image

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

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

image

4. 压缩静态文件

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

5. 测试

image

posted @ 2021-07-28 19:30  SonnyZhang  阅读(1076)  评论(2编辑  收藏  举报