{@snippet features/build-media-source}
The {@link module:mediaembed/mediaembed~MediaEmbed} feature brings a basic support for embeddable, synchronous media in the editor content.
{@snippet features/media-embed}
To add this feature to your editor, install the @ckeditor/ckeditor5-media-embed package:
npm install --save @ckeditor/ckeditor5-media-embed
Then add 'MediaEmbed' to your plugin list and configure the media providers:
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/table';
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ MediaEmbed, ... ],
toolbar: [ 'insertMedia', ... ]
mediaEmbed: {
...
}
} )
.then( ... )
.catch( ... );
The {@link module:mediaembed/mediaembed~MediaEmbed} plugin registers:
'insertMedia' UI button component,the 'insertMedia' command implemented by {@link module:mediaembed/insertmediacommand~InsertMediaCommand}.
You can insert a new media or update the selected media URL by executing the following code:
editor.execute( 'insertMedia', { url: 'http://url.to.the/media' } );
The source code of the feature is available on GitHub in https://github.com/ckeditor/ckeditor5-media-embed.