You are here

public function Audio::prepareMediaSourceFieldFormatterRow in Media Migration 8

Overrides MediaDealerBase::prepareMediaSourceFieldFormatterRow

File

src/Plugin/media_migration/file_entity/Audio.php, line 40

Class

Audio
Audio media migration plugin for local audio media.

Namespace

Drupal\media_migration\Plugin\media_migration\file_entity

Code

public function prepareMediaSourceFieldFormatterRow(Row $row, Connection $connection) : void {
  parent::prepareMediaSourceFieldFormatterRow($row, $connection);
  $options = [
    'type' => 'file_audio',
    'settings' => [
      'controls' => TRUE,
      'autoplay' => FALSE,
      'loop' => FALSE,
      'multiple_file_display_type' => 'tags',
    ],
  ] + $row
    ->getSourceProperty('options') ?? [];
  $row
    ->setSourceProperty('options', $options);
}