Django/CKEditor - config for extraProviders

How can I configure a simple extraProvider for local media in my CKEDITOR_5_CONFIGS in the settings.py file? I tested the configuration below via javascript and it worked fine, but when I switched to python, I got the error Uncaught CKEditorError: this._previewRenderer is not a function. I'm almost giving up and moving on to another alternative, such as directly editing the app.js file of the django-ckedtor-5 library. Any suggestions?

CKEDITOR_5_CONFIGS = {
    ...
    'mediaEmbed': {
        'previewsInData': True,
        'extraProviders': [
            {
                'name': 'LocalProvider',
                'url': '/^https?:\/\/[^\/]+\/media\/videos\/(.+\.(mp4|avi|mov|webm|ogg|mkv))$/',
                'html': 'match => `<video width="640" height="360" controls><source src="${match[0]}" type="video/${match[2]}">Seu navegador não suporta vídeo.</video>`'
            },
        ]
    }
}

enter image description here

enter image description here

Вернуться на верх