You are here

public function VideoPlayerHTML5::settingsSummary in Media entity video 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldFormatter/VideoPlayerHTML5.php \Drupal\media_entity_video\Plugin\Field\FieldFormatter\VideoPlayerHTML5::settingsSummary()
  2. 8.2 src/Plugin/Field/FieldFormatter/VideoPlayerHTML5.php \Drupal\media_entity_video\Plugin\Field\FieldFormatter\VideoPlayerHTML5::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/VideoPlayerHTML5.php, line 56

Class

VideoPlayerHTML5
Plugin implementation of the 'Video Player (HTML5)' formatter.

Namespace

Drupal\media_entity_video\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $provide_download_link = $this
    ->getSetting('provide_download_link');
  $video_attributes = $this
    ->getSetting('video_attributes');
  if ($provide_download_link) {
    $summary[] = $this
      ->t('Download link provided.');
  }
  if ($video_attributes) {
    $summary[] = $this
      ->t('Video tag attributes: @tags.', [
      '@tags' => $video_attributes,
    ]);
  }
  return $summary;
}