@leeonfield/editor-plugin-video

0.2.1 • Public • Published

Video Plugin for TOAST UI Editor

This is a plugin of TOAST UI Editor to embed video in Editor

npm version

Support video list and code language

  • embed iframe
  • video source
    • [x] Mp4: source-mp4
    • [x] OGG: source-ogg
    • [x] 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
```

Package Sidebar

Install

npm i @leeonfield/editor-plugin-video

Weekly Downloads

3

Version

0.2.1

License

MIT

Unpacked Size

10.4 kB

Total Files

4

Last publish

Collaborators

  • leeonfield