Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 1.12 KB

audio.md

File metadata and controls

72 lines (53 loc) · 1.12 KB

Audio extension

Use this extension to render Audio element. The extension uses Plyr as the playback interface.

Options

HTMLAttributes

Custom HTML attributes that should be added to the rendered HTML tag.

Audio.configure({
  HTMLAttributes: {
    class: "my-custom-class",
  },
});

dictionary

If you need to internationalize this extension, you can use this option.

Audio.configure({
  dictionary: {
    name: "Audio",
    inputSrc: "Enter or paste link",
    inputAlt: "Audio description",
    inputTitle: "Audio title",
    audioOpen: "Open audio",
    audioUpload: "Upload audio",
    audioDelete: "Delete audio",
  },
});

inline

Whether to set the audio extension to inline mode.

Audio.configure({
  inline: false,
});

Commands

setAudio()

Insert a new audio element.

editor.commands.setAudio({
  src: "https://example.com",
  title: "example title",
  align: "center",
  width: "100px"
});

InputRules

:audio{https://example.com}

Markdown

:audio{https://example.com}