Package Exports
- @leeonfield/editor-plugin-video
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@leeonfield/editor-plugin-video) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Video Plugin for TOAST UI Editor
This is a plugin of TOAST UI Editor to embed video in Editor
Support video list and code language
- embed iframe
- YouTube: youtube
- Tecent Video: qq
- Bilibili: bilibili
- Youku: youku
- video source
- Mp4: source-mp4
- OGG: source-ogg
- Youku: source-avi
📦 Usage npm
To use the plugin, @toast-ui/editor
must be installed.
Ref. Getting Started
Install
$ npm install @leeonfield/editor-plugin-video -S
Import Plugin
ES Modules
import videoPlugin from '@leeonfield/editor-plugin-video';
CommonJS
const videoPlugin = require('@leeonfield/editor-plugin-video');
Use in Editor
// ...
import Editor from '@toast-ui/editor';
import videoPlugin from '@leeonfield/editor-plugin-video';
const editor = new Editor({
// ...
plugins: [videoPlugin]
});
Use in Viewer
// ...
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]
});
Custom Video list
// ...
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/',
},
},
],
],
});
embed video in markdown
``` youtube
GveTAk727mM
```
video source
```source-mp4
video-source
```