You are here

public function VideoFile::createSourceField in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/Plugin/media/Source/VideoFile.php \Drupal\media\Plugin\media\Source\VideoFile::createSourceField()
  2. 9 core/modules/media/src/Plugin/media/Source/VideoFile.php \Drupal\media\Plugin\media\Source\VideoFile::createSourceField()

Creates the source field definition for a type.

Parameters

\Drupal\media\MediaTypeInterface $type: The media type.

Return value

\Drupal\field\FieldConfigInterface The unsaved field definition. The field storage definition, if new, should also be unsaved.

Overrides File::createSourceField

File

core/modules/media/src/Plugin/media/Source/VideoFile.php, line 26

Class

VideoFile
Media source wrapping around a video file.

Namespace

Drupal\media\Plugin\media\Source

Code

public function createSourceField(MediaTypeInterface $type) {
  return parent::createSourceField($type)
    ->set('settings', [
    'file_extensions' => 'mp4',
  ]);
}