Adds extracted text to Ableplayer Caption media
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
448 B

<?php
/**
* @file
* {@inheritdoc}
*/
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_entity_insert().
*/
function transcript_action_entity_insert(EntityInterface $entity) {
if ($entity->getEntityTypeId() === 'media' && $entity->bundle() === 'able_player_caption') {
$action = \Drupal::service('plugin.manager.action')->createInstance('transcript_action_extract_transcription_text');
$action->execute($entity);
}
}