diff --git a/core/modules/media/src/Plugin/media/Source/OEmbed.php b/core/modules/media/src/Plugin/media/Source/OEmbed.php index d634a59bc7..c2ff05fd5c 100644 --- a/core/modules/media/src/Plugin/media/Source/OEmbed.php +++ b/core/modules/media/src/Plugin/media/Source/OEmbed.php @@ -24,8 +24,17 @@ /** * Provides the media source plugin for oEmbed resources. + * + * @MediaSource( + * id = "oembed", + * label = @Translation("oEmbed source"), + * description = @Translation("Use oEmbed URL for reusable media."), + * allowed_field_types = {"link", "string", "string_long"}, + * default_thumbnail_filename = "no-thumbnail.png", + * deriver = "Drupal\media\Plugin\media\Source\OEmbedDeriver" + * ) */ -abstract class OEmbed extends MediaSourceBase implements MediaSourceFieldConstraintsInterface { +class OEmbed extends MediaSourceBase implements MediaSourceFieldConstraintsInterface { /** * The logger channel for media. diff --git a/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php b/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php new file mode 100644 index 0000000000..412a14a404 --- /dev/null +++ b/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php @@ -0,0 +1,31 @@ +derivatives = [ + 'remote_video' => [ + 'id' => 'remote_video', + 'label' => t('Remote video'), + 'description' => t('Use remote video URL for reusable media.'), + 'settings' => [ + 'supported_providers' => ['YouTube', 'Vimeo'], + ], + ] + $base_plugin_definition, + ]; + + return parent::getDerivativeDefinitions($base_plugin_definition); + } + +} diff --git a/core/modules/media/src/Plugin/media/Source/RemoteVideo.php b/core/modules/media/src/Plugin/media/Source/RemoteVideo.php deleted file mode 100644 index 8de3f31957..0000000000 --- a/core/modules/media/src/Plugin/media/Source/RemoteVideo.php +++ /dev/null @@ -1,19 +0,0 @@ -