You are here

public function VideoPlayerFormatter::settingsSummary in Video 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/VideoPlayerFormatter.php \Drupal\video\Plugin\Field\FieldFormatter\VideoPlayerFormatter::settingsSummary()

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/VideoPlayerFormatter.php, line 145

Class

VideoPlayerFormatter
Plugin implementation of the 'video_player' formatter.

Namespace

Drupal\video\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $summary[] = t('HTML5 Video (@widthx@height@controls@autoplay@loop@muted).', [
    '@width' => $this
      ->getSetting('width'),
    '@height' => $this
      ->getSetting('height'),
    '@controls' => $this
      ->getSetting('controls') ? t(', controls') : '',
    '@autoplay' => $this
      ->getSetting('autoplay') ? t(', autoplaying') : '',
    '@loop' => $this
      ->getSetting('loop') ? t(', looping') : '',
    '@muted' => $this
      ->getSetting('muted') ? t(', muted') : '',
  ]);
  return $summary;
}