public function AudioFile::createSourceField in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/src/Plugin/media/Source/AudioFile.php \Drupal\media\Plugin\media\Source\AudioFile::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/ AudioFile.php, line 26
Class
- AudioFile
- Media source wrapping around an audio file.
Namespace
Drupal\media\Plugin\media\SourceCode
public function createSourceField(MediaTypeInterface $type) {
return parent::createSourceField($type)
->set('settings', [
'file_extensions' => 'mp3 wav aac',
]);
}