You are here

public function MediaElementVideoFieldFormatter::settingsSummary in MediaElement 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 FileVideoFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/MediaElementVideoFieldFormatter.php, line 236

Class

MediaElementVideoFieldFormatter
Plugin implementation of the 'mediaelement_file_video' formatter.

Namespace

Drupal\mediaelement\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = $this
    ->traitSettingsSummary();
  $summary[] = $this
    ->t('Poster Image Field: %field', [
    '%field' => $this
      ->getImageFieldOptions()[$this->settings['poster_image_field']],
  ]);
  if ($this->settings['poster_image_field'] != 'none') {
    $summary[] = $this
      ->t('Poster Image Style: %style', [
      '%style' => $this
        ->getImageStyleOptions()[$this->settings['poster_image_style']],
    ]);
  }
  return $summary;
}