Provides Video Blocks for the Editor.js.
Works only with pasted videos and URLs and requires no server-side uploader.
Get the package
npm i --save-dev simple-video-editorjs
Include module at your application
const SimpleVideo = require('simple-video-editorjs');
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/simple-video-editorjs@latest
Then require this script on page with Editor.js.
<script src="..."></script>
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
video: SimpleVideo,
}
...
});
This Tool has no config params
- Stretch to full-width
- Add default HTML controls for playback
- Enable autoplay and muted video.
Field | Type | Description |
---|---|---|
url | string |
video's url |
caption | string |
video's caption |
autoplay | boolean |
video will autoplay |
muted | boolean |
video will be muted by defaul |
controls | boolean |
video should display default controls |
stretched | boolean |
stretch video to screen's width |
{
"type" : "video",
"data" : {
"url" : "https://paul.kinlan.me/videos/2019-11-05--test-post-video-upload-0.mp4",
"caption" : "An aweomse video",
"autoplay" : false,
"controls" : false,
"muted": false,
"stretched" : true
}
}