quill-audio-format

1.0.1 • Public • Published

quill-audio-format

npm-image

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

upload audio with drag and drop to quill editor

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.

Package Sidebar

Install

npm i quill-audio-format

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

1.27 MB

Total Files

21

Last publish

Collaborators

  • muhun-uniquegood