You are here

public function Video::appliesTo in Varbase Media 8.5

Checks if this media type can handle a given input value.

Parameters

mixed $value: The input value.

\Drupal\media\MediaTypeInterface $bundle: The media bundle that is using this plugin.

Return value

bool TRUE if the input can be handled by this plugin, FALSE otherwise.

Overrides InputMatchInterface::appliesTo

File

src/Plugin/media/Source/Video.php, line 17

Class

Video
Input-matching version of the VideoEmbedField media type.

Namespace

Drupal\varbase_media\Plugin\media\Source

Code

public function appliesTo($value, MediaTypeInterface $media_type) {
  $value = $this
    ->toString($value);
  return isset($value) ? (bool) $this->providerManager
    ->loadProviderFromInput($value) : FALSE;
}