CKeditor5 media embed

222 views Asked by At

Im developing an application that uses ckeditor5, when I put a media embed I can visualize it, but when i got the source from the database, I cannot see it on the web page, This is the html that i got from the database:

<figure class=\"media\"><oembed url=\"https://www.youtube.com/watch?v=Gp-8l7cFNM8\"></oembed></figure>

But it doesnt show up on the page, reading the ckeditor5 documentation they show how to use embedded media, but it doesnt work on my web page, heres how they show how to do it

<head>
    ...
    <script async charset="utf-8" src="//cdn.embedly.com/widgets/platform.js"></script>
    ...
</head>
<figure class="media">
    <oembed url="https://twitter.com/ckeditor/status/1021777799844126720"></oembed>
</figure>
<script>
    document.querySelectorAll( 'oembed[url]' ).forEach( element => {
        // Create the <a href="..." class="embedly-card"></a> element that Embedly uses
        // to discover the media.
        const anchor = document.createElement( 'a' );

        anchor.setAttribute( 'href', element.getAttribute( 'url' ) );
        anchor.className = 'embedly-card';

        element.appendChild( anchor );
    } );
</script>

My question is, how i do it using angular

I tried to use, the ckeditor documentation, but it seems like it doesnt work with angular

0

There are 0 answers