OEmbedDeriver.php in Drupal 10
File
core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php
View source
<?php
namespace Drupal\media\Plugin\media\Source;
use Drupal\Component\Plugin\Derivative\DeriverBase;
class OEmbedDeriver extends DeriverBase {
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = [
'video' => [
'id' => 'video',
'label' => t('Remote video'),
'description' => 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);
}
}
Classes
Name |
Description |
OEmbedDeriver |
Derives media source plugin definitions for supported oEmbed providers. |