Class

Media (media-embed)

@ckeditor/ckeditor5-media-embed/src/mediaregistry

class private

Represents media defined by the provider configuration.

It can be rendered to the view element and used in the editing or data pipeline.

Filtering

Properties

  • _match : Object

    The output of the RegExp.match which validated the url of this media.

  • _previewRenderer : function

    The function returning the HTML string preview of this media.

  • url : String

    The URL this Media instance represents.

Methods

  • _getPlaceholderHtml() → String

    Returns the placeholder HTML when the media has no content preview.

    Returns

    String
  • _getPreviewHtml( writer, options = { [options.renderForEditingView] } ) → String

    Returns the HTML string of the media content preview.

    Parameters

    writer : DowncastWriter

    The view writer used to produce a view element.

    options : Object
    Properties
    [ options.renderForEditingView ] : String

    Returns

    String
  • _getValidUrl( url ) → String | null

    Returns the full URL to the specified media.

    Parameters

    url : String

    The URL of the media.

    Returns

    String | null
  • _t()

    Shorthand for t.

    Related:

  • getViewElement( writer, options = { [options.elementName], [options.renderMediaPreview], [options.renderForEditingView] } ) → Element

    Returns the view element representation of the media.

    Parameters

    writer : DowncastWriter

    The view writer used to produce a view element.

    options : Object
    Properties
    [ options.elementName ] : String
    [ options.renderMediaPreview ] : String
    [ options.renderForEditingView ] : String

    Returns

    Element