You are here

public function FileVideoFormatter::settingsSummary in File Entity (fieldable files) 8.2

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/FileVideoFormatter.php, line 155

Class

FileVideoFormatter
Plugin implementation of the 'file_video' formatter.

Namespace

Drupal\file_entity\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = array();
  $summary[] = t('Controls: %controls', array(
    '%controls' => $this
      ->getSetting('controls') ? 'visible' : 'hidden',
  ));
  $summary[] = t('Autoplay: %autoplay', array(
    '%autoplay' => $this
      ->getSetting('autoplay') ? t('yes') : t('no'),
  ));
  $summary[] = t('Loop: %loop', array(
    '%loop' => $this
      ->getSetting('loop') ? t('yes') : t('no'),
  ));
  $summary[] = t('Muted: %muted', array(
    '%muted' => $this
      ->getSetting('muted') ? t('yes') : t('no'),
  ));
  $summary[] = t('Plays inline: %playsinline', array(
    '%playsinline' => $this
      ->getSetting('playsinline') ? t('yes') : t('no'),
  ));
  $width = $this
    ->getSetting('width');
  $height = $this
    ->getSetting('height');
  if ($width && $height) {
    $summary[] = t('Size: %width x %height pixels', array(
      '%width' => $this
        ->getSetting('width'),
      '%height' => $this
        ->getSetting('height'),
    ));
  }
  $summary[] = t('Multiple files: %multiple', array(
    '%multiple' => $this
      ->getSetting('multiple_file_behavior'),
  ));
  return $summary;
}