PHP code example of johncms / ckeditor-media-embed

1. Go to this page and download the library: Download johncms/ckeditor-media-embed library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

johncms / ckeditor-media-embed example snippets


$providers = [
    new \Simba77\EmbedMedia\Providers\Youtube(
        [
            'classes' => 'embed-responsive embed-responsive-16by9',
            'styles'  => [
                'max-width' => '100%',
                'width'     => '100%',
            ],
        ]
    ),
];

$embed = new \Simba77\EmbedMedia\Embed($providers);

$html = '<figure class="media"><oembed url="https://youtu.be/8ZLSKEmbt0Y?t=75"></oembed></figure>';

echo $embed->embedMedia($html);