function AudioFile::createSourceField

Same name in other branches
  1. 8.9.x core/modules/media/src/Plugin/media/Source/AudioFile.php \Drupal\media\Plugin\media\Source\AudioFile::createSourceField()
  2. 10 core/modules/media/src/Plugin/media/Source/AudioFile.php \Drupal\media\Plugin\media\Source\AudioFile::createSourceField()
  3. 11.x core/modules/media/src/Plugin/media/Source/AudioFile.php \Drupal\media\Plugin\media\Source\AudioFile::createSourceField()

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\Source

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.