Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / media / src / Plugin / media / Source / OEmbedDeriver.php
diff --git a/web/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php b/web/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php
new file mode 100644 (file)
index 0000000..8da3265
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\media\Plugin\media\Source;
+
+use Drupal\Component\Plugin\Derivative\DeriverBase;
+
+/**
+ * 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.
+ */
+class OEmbedDeriver extends DeriverBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  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);
+  }
+
+}