Video.php in Media Migration 8
File
src/Plugin/media_migration/file_entity/Video.php
View source
<?php
namespace Drupal\media_migration\Plugin\media_migration\file_entity;
use Drupal\Core\Database\Connection;
use Drupal\migrate\Row;
class Video extends FileBase {
public function getDestinationMediaTypeSourceFieldLabel() {
return 'Video file';
}
public function getDestinationMediaTypeLabel() {
return implode(' ', array_filter([
'Video',
$this->configuration['scheme'] === 'public' ? NULL : "({$this->configuration['scheme']})",
]));
}
public function prepareMediaSourceFieldFormatterRow(Row $row, Connection $connection) : void {
parent::prepareMediaSourceFieldFormatterRow($row, $connection);
$options = [
'type' => 'file_video',
'settings' => [
'muted' => FALSE,
'width' => 640,
'height' => 480,
],
] + $row
->getSourceProperty('options') ?? [];
$row
->setSourceProperty('options', $options);
}
}
Classes
Name |
Description |
Video |
Video media migration plugin for local video media entities. |