function FileVideoFormatter::prepareAttributes

Same name in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\FileVideoFormatter::prepareAttributes()
  2. 10 core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\FileVideoFormatter::prepareAttributes()
  3. 11.x core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\FileVideoFormatter::prepareAttributes()

Overrides FileMediaFormatterBase::prepareAttributes

File

core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php, line 88

Class

FileVideoFormatter
Plugin implementation of the 'file_video' formatter.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

protected function prepareAttributes(array $additional_attributes = []) {
    return parent::prepareAttributes([
        'muted',
    ])->setAttribute('width', $this->getSetting('width'))
        ->setAttribute('height', $this->getSetting('height'));
}

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