function AudioFile::prepareViewDisplay

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

Overrides MediaSourceBase::prepareViewDisplay

File

core/modules/media/src/Plugin/media/Source/AudioFile.php, line 34

Class

AudioFile
Media source wrapping around an audio file.

Namespace

Drupal\media\Plugin\media\Source

Code

public function prepareViewDisplay(MediaTypeInterface $type, EntityViewDisplayInterface $display) {
    $display->setComponent($this->getSourceFieldDefinition($type)
        ->getName(), [
        'type' => 'file_audio',
        'label' => 'visually_hidden',
    ]);
}

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