0.0.6 • Published 5 years ago
xws-editor-video v0.0.6
Video Tool
Image Block for the Editor.js.
Features
- Uploading file from the device
- Pasting copied content from the web
- Pasting images by drag-n-drop
- Pasting files and screenshots from Clipboard
- Allows to add border, background
- Allows to stretch image to the container's full-width
Note This Tool requires server-side implementation for file uploading. See backend response format for more details.
Installation
Install via NPM
Get the package
npm i --save-dev xws-editor-video
Include module at your application
import VideoTool from "xws-editor-video";
Other methods
Manual downloading and connecting
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
import VideoTool from 'xws-editor-video';
// or if you inject ImageTool via standalone script
const VideoTool = window.VideoTool;
var editor = EditorJS({
...
tools: {
...
video: {
class: VideoTool,
config: {
uploader: {
uploadByFile(file) {
return axiosInstance.post("/aa039/upload/video", {
file: file, isFormData: true
}).then(function (res) {
return {
success: 1,
file: {
url: res.data.cos_data.data.source_url
}
};
});
}
}
}
}
...
});