quill-audio-format
v1.0.1
Published
A module for Quill rich text editor to add audio format and allow audio to be uploaded to a server.
Downloads
2
Maintainers
Readme
quill-audio-format
A module for Quill rich text editor to add audio format and allow audio to be uploaded to a server.
Adds a button to the toolbar for users to click, also handles drag and dropped.
Preview
How to setup
import Quill from 'quill';
import AudioUploader from 'quill-audio-format';
Quill.register('modules/audioUploader', AudioUploader);
const mp3UrlForMockResponse =
'https://cdn.realworld.to/project-files/tSJAUCsbD8aSDM7e8XN_AA/KFY6kUxGl8wPJF6EzchhEA-%E1%84%8B%E1%85%B5%E1%86%AF%E1%84%8B%E1%85%A5%E1%84%82%E1%85%A1%E1%84%89%E1%85%A7%E1%84%8B%E1%85%A3%E1%84%92%E1%85%A1%E1%86%B8%E1%84%82%E1%85%B5%E1%84%83%E1%85%A1.mp3';
const quill = new Quill('#editor-container', {
modules: {
toolbar: ['audio'],
audioUploader: {
upload: (file) =>
new Promise((resolve, reject) => {
setTimeout(() => resolve(mp3UrlForMockResponse), 2000);
})
}
},
theme: 'snow'
});
quill-audio-uploader is primarily distributed under the terms of the MIT license. See LICENSE for details.
This module was initial created by modifying the quill-image-uploader source code.