function OEmbedDeriver::getDerivativeDefinitions

Same name in other branches
  1. 9 core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php \Drupal\media\Plugin\media\Source\OEmbedDeriver::getDerivativeDefinitions()
  2. 8.9.x core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php \Drupal\media\Plugin\media\Source\OEmbedDeriver::getDerivativeDefinitions()
  3. 10 core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php \Drupal\media\Plugin\media\Source\OEmbedDeriver::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php, line 22

Class

OEmbedDeriver
Derives media source plugin definitions for supported oEmbed providers.

Namespace

Drupal\media\Plugin\media\Source

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives = [
        'video' => [
            'id' => 'video',
            'label' => $this->t('Remote video'),
            'description' => $this->t('Use remote video URL for reusable media.'),
            'providers' => [
                'YouTube',
                'Vimeo',
            ],
            'default_thumbnail_filename' => 'video.png',
        ] + $base_plugin_definition,
    ];
    return parent::getDerivativeDefinitions($base_plugin_definition);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.