You are here

function hook_video_embed_field_provider_info_alter in Video Embed Field 8

Same name and namespace in other branches
  1. 8.2 video_embed_field.api.php \hook_video_embed_field_provider_info_alter()

Alter the video_embed_field plugin definitions.

This hook allows you alter the plugin definitions managed by ProviderManager. This could be useful if you wish to remove a particular definition or perhaps replace one with your own implementation (as demonstrated).

1 invocation of hook_video_embed_field_provider_info_alter()
ProviderManager::__construct in src/ProviderManager.php
Creates the discovery object.

File

./video_embed_field.api.php, line 47
Hooks provided by video_embed_field.

Code

function hook_video_embed_field_provider_info_alter(&$definitions) {

  // Replace the YouTube provider class with another implementation.
  $definitions['youtube']['class'] = 'Drupal\\my_module\\CustomYouTubeProvider';
}