You are here

public function VideoJsPlayerFormatter::settingsSummary in Video.js (HTML5 Video Player) 8

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/VideoJsPlayerFormatter.php, line 151
Contains \Drupal\videojs\Plugin\Field\FieldFormatter\VideJsPlayerFormatter.

Class

VideoJsPlayerFormatter
Plugin implementation of the 'videojs_player' formatter.

Namespace

Drupal\videojs\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = array();
  $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;
}