You are here

public function BrightcoveVideo::getMetadataAttributes in Brightcove Video Connect 8.2

Same name and namespace in other branches
  1. 3.x modules/media_brightcove/src/Plugin/media/Source/BrightcoveVideo.php \Drupal\media_brightcove\Plugin\media\Source\BrightcoveVideo::getMetadataAttributes()

Gets a list of metadata attributes provided by this plugin.

Most media sources have associated metadata, describing attributes such as:

  • dimensions
  • duration
  • encoding
  • date
  • location
  • permalink
  • licensing information
  • ...

This method should list all metadata attributes that a media source MAY offer. In other words: it is possible that a particular media item does not contain a certain attribute. For example: an oEmbed media source can contain both video and images. Images don't have a duration, but videos do.

(The term 'attributes' was chosen because it cannot be confused with 'fields' and 'properties', both of which are concepts in Drupal's Entity Field API.)

Return value

array Associative array with:

  • keys: metadata attribute names
  • values: human-readable labels for those attribute names

Overrides MediaSourceInterface::getMetadataAttributes

File

modules/media_brightcove/src/Plugin/media/Source/BrightcoveVideo.php, line 29

Class

BrightcoveVideo
Brightcove Video entity media source.

Namespace

Drupal\media_brightcove\Plugin\media\Source

Code

public function getMetadataAttributes() {
  return [
    'name' => $this
      ->t('Name'),
    'api_client' => $this
      ->t('API Client'),
    'player' => $this
      ->t('Player'),
    'video_id' => $this
      ->t('Video ID'),
    'duration' => $this
      ->t('Video Duration'),
    'description' => $this
      ->t('Short description'),
    'long_description' => $this
      ->t('Long description'),
    'poster' => $this
      ->t('Video Still'),
    'thumbnail' => $this
      ->t('Thumbnail'),
    // TODO: Check if these are useful in the Brightcove Video media source.
    'complete' => $this
      ->t('Complete'),
    'reference_id' => $this
      ->t('Reference ID'),
    'state' => $this
      ->t('State'),
    'tags' => $this
      ->t('Tags'),
    'custom_fields' => $this
      ->t('Custom fields'),
    'geo' => $this
      ->t('Geo information'),
    'geo.countries' => $this
      ->t('Geo countries'),
    'geo.exclude_countries' => $this
      ->t('Exclude countries'),
    'geo.restricted' => $this
      ->t('Geo Restricted'),
    'schedule' => $this
      ->t('Schedule'),
    'starts_at' => $this
      ->t('Starts at'),
    'ends_at' => $this
      ->t('Ends at'),
    'picture_thumbnail' => $this
      ->t('Thumbnail picture'),
    'picture_poster' => $this
      ->t('Picture poster'),
    'video_source' => $this
      ->t('Video source'),
    'economics' => $this
      ->t('Economics'),
    'partner_channel' => $this
      ->t('Partner channel'),
  ];
}