1.0.1 • Published 1 year ago

quill-audio-format v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

1.0.1

1 year ago

1.0.0

1 year ago