function FileVideoFormatter::prepareAttributes
Same name in other branches
- 9 core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\FileVideoFormatter::prepareAttributes()
- 8.9.x core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\FileVideoFormatter::prepareAttributes()
- 10 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 98
Class
- FileVideoFormatter
- Plugin implementation of the 'file_video' formatter.
Namespace
Drupal\file\Plugin\Field\FieldFormatterCode
protected function prepareAttributes(array $additional_attributes = []) {
$attributes = parent::prepareAttributes([
'muted',
]);
if ($width = $this->getSetting('width')) {
$attributes->setAttribute('width', $width);
}
if ($height = $this->getSetting('height')) {
$attributes->setAttribute('height', $height);
}
return $attributes;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.