This is a plugin of TOAST UI Editor to embed video in Editor
- embed iframe
- YouTube: youtube
- Tecent Video: qq
- Bilibili: bilibili
- Youku: youku
- video source
- Mp4: source-mp4
- OGG: source-ogg
- Youku: source-avi
To use the plugin, @toast-ui/editor
must be installed.
Ref. Getting Started
$ npm install @leeonfield/editor-plugin-video -S
import videoPlugin from '@leeonfield/editor-plugin-video';
const videoPlugin = require('@leeonfield/editor-plugin-video');
// ...
import Editor from '@toast-ui/editor';
import videoPlugin from '@leeonfield/editor-plugin-video';
const editor = new Editor({
// ...
plugins: [videoPlugin]
});
// ...
import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer';
import videoPlugin from '@leeonfield/editor-plugin-video';
// ...
const viewer = new Viewer({
// ...
plugins: [videoPlugin]
});
or
// ...
import Editor from '@toast-ui/editor';
import videoPlugin from '@leeonfield/editor-plugin-video';
// ...
const viewer = Editor.factory({
// ...
viewer: true,
plugins: [videoPlugin]
});
// ...
import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer';
import videoPlugin from '@leeonfield/editor-plugin-video';
// ...
const viewer = new Viewer({
// ...
plugins: [
[
videoPlugin,
{
list: {
youtube: 'http://player.youku.com/embed/',
},
},
],
],
});
``` youtube
GveTAk727mM
```
```source-mp4
video-source
```