mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat: 直接粘贴视频上传功能
This commit is contained in:
@@ -476,6 +476,9 @@ function uploadResource($id, $callback) {
|
||||
case "video/mp4":
|
||||
fileName += ".mp4";
|
||||
break;
|
||||
case "video/webm":
|
||||
fileName += ".webm";
|
||||
break;
|
||||
default :
|
||||
layer.msg(locales[lang].unsupportType);
|
||||
return;
|
||||
|
||||
@@ -251,14 +251,16 @@ $(function () {
|
||||
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
|
||||
});
|
||||
} else if ($state === "success") {
|
||||
if ($res[0].errcode === 0) {
|
||||
if ($res[0].resource_type === 'video') {
|
||||
let value = `<video controls><source src="${$res[0].url}" type="video/mp4"></video>`;
|
||||
if ($res.errcode === 0) {
|
||||
if ($res.resource_type === 'video') {
|
||||
let value = `<video controls><source src="${$res.url}" type="video/mp4"></video>`;
|
||||
window.editor.insertValue(value);
|
||||
} else {
|
||||
let value = '';
|
||||
let value = '';
|
||||
window.editor.insertValue(value);
|
||||
}
|
||||
} else {
|
||||
layer.msg("上传失败:" + $res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user