You are here

lightning_media_video.module in Lightning Media 8

Support for videos as media entities in Lightning.

File

modules/lightning_media_video/lightning_media_video.module
View source
<?php

/**
 * @file
 * Support for videos as media entities in Lightning.
 */
use Drupal\lightning_core\OverrideHelper as Override;
use Drupal\lightning_media_video\Plugin\media\Source\Video;

/**
 * Implements hook_media_source_info_alter().
 */
function lightning_media_video_media_source_info_alter(array &$sources) {
  $sources['video_embed_field']['input_match'] = [
    'field_types' => [
      'string',
      'string_long',
      'video_embed_field',
    ],
  ];
  $sources['video_embed_field']['preview'] = TRUE;
  Override::pluginClass($sources['video_embed_field'], Video::class);
}