Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. OEmbedDeriver.php

class OEmbedDeriver

Derives media source plugin definitions for supported oEmbed providers.

@internal This is an internal part of the oEmbed system and should only be used by oEmbed-related code in Drupal core.

Hierarchy

  • class \Drupal\Component\Plugin\Derivative\DeriverBase implements \Drupal\Component\Plugin\Derivative\DeriverInterface
    • class \Drupal\media\Plugin\media\Source\OEmbedDeriver extends \Drupal\Component\Plugin\Derivative\DeriverBase uses \Drupal\Core\StringTranslation\StringTranslationTrait

Expanded class hierarchy of OEmbedDeriver

File

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

Namespace

Drupal\media\Plugin\media\Source
View source
class OEmbedDeriver extends DeriverBase {
    use StringTranslationTrait;
    
    /**
     * {@inheritdoc}
     */
    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);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
OEmbedDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
StringTranslationTrait::$stringTranslation protected property The string translation service.
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use.
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal