@akilli/ckeditor5-media

3.0.4 • Public • Published

akilli/ckeditor5-media

This media widget for CKEditor 5 can embed image, audio, video and iframe elements wrapped within a figure optionally with a caption. It also provides a minimal API to integrate a media browser by the use of the window.postMessage() function.

This widget will add the CSS class image, audio, video or iframe to the figure element. It also supports alignment by setting an appropriate CSS class (left or right), and the attributes width, height and alt. The controls(audio and video) and allowfullscreen (iframe) are automatically set.

Media Browser

You can implement your media browser as you wish, the only two requirements are that you configure the URL to your media browser as media.browser p.e.

const editorConfig = {
    ...
    media: {
        ...
        browser: '/url/to/mediabrowser',
        ...
    },
    ...
})

and that your media browser notifies the editor by posting a message p.e. like

window.opener.postMessage({
    alt: 'Optional alternative text',
    src: '/url/to/media'
}, origin);

Demo

/@akilli/ckeditor5-media/

    Package Sidebar

    Install

    npm i @akilli/ckeditor5-media

    Weekly Downloads

    18

    Version

    3.0.4

    License

    GPL-2.0-or-later

    Unpacked Size

    63.1 kB

    Total Files

    35

    Last publish

    Collaborators

    • akilli